playMaker

Author Topic: How to rotate a child to always face up vector[SOLVED]  (Read 2396 times)

cmy

  • Playmaker Newbie
  • *
  • Posts: 40
How to rotate a child to always face up vector[SOLVED]
« on: February 15, 2014, 09:42:14 AM »
I've been struggling on a problem for a few days. I have a gameobject that runs "itween look at update" and it essentially looks at the center of a sphere but always remains on the spheres surface. I have a gameobject as its child and I need it to be able to look left and right but always point directly away from the sphere, basically keeping it standing on the surface.

I now want to move the parent on the surface of the sphere and keep the child "standing" but also facing it's destination (that's the tricky part). I have it 60% working but I can't keep that child standing properly without crashing into the sphere geometry. I use "smooth look at" to turn the child towards the move target, but it won't stay perpendicular. Keep Vertical is not helping, and the Up Vector options are of no use.

EDIT: I've also used itween move to with "orient to path" enabled. The gameobject smoothly keeps perpendicular to the sphere, but it is impossible to "look at" the target.

Any ideas?
« Last Edit: February 17, 2014, 10:21:26 AM by jeanfabre »

cmy

  • Playmaker Newbie
  • *
  • Posts: 40
Re: How to rotate a child to always face up vector
« Reply #1 on: February 15, 2014, 07:47:21 PM »
As per usual I answered my own question with a bit more digging. This solved all my troubles:

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

Jean, you are a ninja.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to rotate a child to always face up vector[SOLVED]
« Reply #2 on: February 17, 2014, 10:22:08 AM »
 ;D

thanks for cross referencing, always important.

bye,

 Jean