playMaker

Author Topic: Up Vector on Smooth Look At Direction action  (Read 1943 times)

markinjapan

  • Full Member
  • ***
  • Posts: 103
Up Vector on Smooth Look At Direction action
« on: February 19, 2013, 11:02:41 AM »
Hi,

Not sure if I'm using this properly but just wanted to ask someone about it.

Am I correct in thinking that I can give the Smooth Look At Direction action a direction vector (to Look At) and also give it a vector as an Up Vector? (the orientation of the object)

What I want is to be able to place, say, a turret on a slope, at an angle, and then have it Look at something. I want it to rotate only around its local Y axis as it tracks whatever is near it.

I've tried to get this to work but I can't figure it out.

I'm getting the direction to 'something' (by subtracting the something position from the turret position) and then I'm 0'ing out the Y component as I don't need the turret to look up or down. Then I feed this into the Smooth Look At Direction action. Which works perfectly but my turret is standing upright.

I figured I could raycast to the floor and get the normal and use that as an Up Vector. This kind of works but my turret still wobbles, it's not just rotating straight around it's Y axis.

I know I'm doing something wrong somewhere but can't figure it out.

Thanks