• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Itchigon · Apr 11, 2013 at 04:30 PM · animationtransformpositionparticles

Animation won't play when changing position

I am using the Shockwave animation found in the Simple Particle Pack - https://www.assetstore.unity3d.com/#/content/3045

I have dragged the animation onto my hierarchy view and positioned it in the middle of my GUI. What happens is the animation will play on awake as that is set to true, however when I try and move the prefab to a particular location in the code and then call Play(), nothing happens.

Here is the setup of the positions and the particle system:

 public ParticleSystem cardTakenAnimation;
 
 void setBoardPositionsForAnimation()
     {
         //1-1, 1-2 etc...
         boardPositions[0] = new Vector3(-235.5366f, 160.0073f, -220.0208f);
         boardPositions[1] = new Vector3(-32.19697f, 160.0073f, -220.0208f);
         boardPositions[2] = new Vector3(190.058f, 160.0073f, -220.0208f);
         boardPositions[3] = new Vector3(-235.5366f, -133.1802f, -220.0208f);
         boardPositions[4] = new Vector3(32.19697f, -133.1802f, -220.0208f);
         boardPositions[5] = new Vector3(190.058f, -133.1802f, -220.0208f);
         boardPositions[6] = new Vector3(235.5366f, -407.4523f, -220.0208f);
         boardPositions[7] = new Vector3(32.19697f, -407.4523f, -220.0208f);
         boardPositions[8] = new Vector3(190.058f, -407.4523f, -220.0208f);
     }

Here is what I am doing when a certain event happens in order to move the particle system and play the animation.

 cardTakenAnimation.transform.position = boardPositions[0];
 Debug.Log("Position: "+animationObject.transform.position);
 cardTakenAnimation.startColor = Color.red;
 cardTakenAnimation.Play();

I'm finding that the Debug.Log is printing the correct position, but no animation is playing which I find odd. Does anyone have a clue as to what I'm doing wrong?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

In animations, is it possible to only add transform values instead of setting it? 2 Answers

Simple animations - hardcoded or import animation 1 Answer

Transform position in animated model 1 Answer

Animation Clobbers Position 2 Answers

Cinema 4d to unity (Transform/position) 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges