playMaker

Author Topic: Rotating and scaling at the same time (either sprite or GO)  (Read 1465 times)

paulgl

  • Playmaker Newbie
  • *
  • Posts: 2
Rotating and scaling at the same time (either sprite or GO)
« on: January 06, 2015, 07:28:12 PM »
Hi,

My first of undoubtedly many questions - I've been trying to get this to work for 3 hours, and searching the forum isn't helping me (which doesn't mean the answer isn't here somewhere).

I have a stationary GameObject (cube) with a sprite childed to it.  I'd like to rotate and shrink the sprite (at the same time, over about 1 second).

My FSM is on the cube.  I've tried "iTween Rotate Add" acting on self, on "Specify GameObject" pointing to the cube (which should be the same as self, I think), and on "Specify GameObject" pointing to the sprite.  In every case, I get the error:
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
iTween.RetrieveArgs () (at Assets/Plugins/Pixelplacement/iTween/iTween.cs:6811)

(If it matters, I'm working on a prefab, with a single instance in the scene. I'm planning to reuse it as a game counter, many times.)

I had no rigidbody, but I tried adding one to the cube with "Is Kinematic" checked, in case that worked - it didn't.  I'm not planning to use the physics engine for my game (I think, though it might be that iTween inherently uses it).

Is there some reason I can't do this within a prefab?  Probably I've just misunderstood something (or everything).  Should be using a totally different method?

Even if I can get this working, presumably I can't do a rotate and scale together - possibly I need to make a custom action?

Thanks for any suggestions!
Paul