playMaker

Author Topic: [SOLVED] How to offset the rotation origin with Rotate action?  (Read 5343 times)

markinjapan

  • Full Member
  • ***
  • Posts: 103
Edit - I've set this to solved as this solves the problem I had (kinda). Now to bug someone from Unity to make it so you can offset the pivot position...


Hi,

Wondering what is the best way to offset the rotation point of a Game Object in the Rotate action?

I'm playing around making a game like Edge (rolling cube game) so I need to offset the rotation vector so that the Cube rotates along it's edge, not the centre as it normally does.

At the moment, I have multiple empty GameObject which I parent to the Cube as it rolls, but I'd like something a little cleaner and easier to read.

I've tried the rotatearound action but that seems to be the same thing I'm doing already. Ideally, it would be nice just to be able to offset the rotation point by updating a local offset rotation vector.

Also, what does the 'Vector' setting in the Rotate action do? I was thinking that might be a way to offset the rotation but it doesn't seem to do anything.

Thanks
« Last Edit: June 06, 2012, 10:27:37 AM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to offset the rotation origin with Rotate action?
« Reply #1 on: June 04, 2012, 05:55:09 AM »
Hi,

I think what you would like is to change the "pivot point" of the object, like we can in 3ds max or maya, basically changing the transform of a gameObject without changing the actual mesh position ( relative to where the transform is). Unfortunatly, and for very obscur lack of reasons, it's not available in Unity.

-- either you parent a dummy object to your mesh, and then you effectivly have the ability to do what you want, else, you will need the rotateAround script I wrote ( that you mention actually)

http://hutonggames.com/playmakerforum/index.php?topic=1078.0

the "vector" is the actual rotation axis definition, cause you could rotate around specific direction, BUT this vector is used from the actual transform position, so no offset... ( where rotate around action do)

 Bye,

 Jean