Author Topic: Lock smooth look at function axis.  (Read 37 times)


  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Lock smooth look at function axis.
« on: September 11, 2017, 04:40:13 AM »

I just asked a question about smooth roll movement here on the forum and I thought that I had figured it out.

I wanted smooth movement to rotate my player in a shmup like game on the y axis using a controller.
I use an object in front of the player to roll him to the left and right.
This works great and I get the movement I want.

However my problem now is that when I rotate the player, the smooth look at counters the rotation and treats the object like it’s a head. Not rotating in the z axis (it stays y axis op in world space).

My question now is:
How can I let the look at function adjust to the rotation of the tracked object for the roll?
Or lock the z axes so the object follows only on the y axis?

I tried to set the up vector to always check the world space y of the player and setting the up vector of the smooth look at according. And of course inside of the look at function the up vector y to 1. But this doesn’t work.

Attached an image to clarify what my result right now is and wat I want to achieve.
« Last Edit: September 11, 2017, 10:50:33 AM by agito1987 »


  • Administrator
  • Hero Member
  • *****
  • Posts: 12089
  • Official Playmaker Support
    • View Profile
Re: Lock smooth look at function axis.
« Reply #1 on: September 12, 2017, 01:26:22 AM »

 you likely need to add a level of indirection with a dummy parent and then your player mesh, so that when you rotate this way, you rotate the child, not the parent, and each gameobject is then responsible for a sub part of the whole player behaviour.