playMaker

Author Topic: Limiting iTween Rotate To to only one axis?  (Read 5485 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
Limiting iTween Rotate To to only one axis?
« on: July 29, 2012, 08:09:12 AM »
I'm trying to cast a fishing rod in a game. I've made it so when the player holds the mouse button down it pulls the rod backwards and when the player releases the mouse button the rod whips forward to cast.

Everything works but I'd like to limit the forward motion to the x axis as it rotates round the other axis at random and looks weird.

iTween Rotate To is set to rotate to 0 on all axis.

Horror

  • Junior Playmaker
  • **
  • Posts: 79
Re: Limiting iTween Rotate To to only one axis?
« Reply #1 on: July 29, 2012, 09:11:30 AM »
Is your iTween set to World or Local space? Also, have you changed the default orientation of the fishing rod in the scene? Drop another one in there from your project panel and check that they match up.

I'm not sure without seeing the setup, but assuming you are using a Vector Rotation it sounds like your rod might be rotating back to its default orientation of 0 on the Y and Z axis. So if you added your rod to the scene and then set it's rotation on the Z axis to 90, then it's going to rotate back to 0 when you cast the line.

You could try using an iTween Rotate Add, as this should add/subtract from the current rotation rather than setting it to the supplied vector. That way you can leave your Y and Z axis set to 0 and it will not change.
« Last Edit: July 29, 2012, 09:27:04 AM by Horror »