playMaker

Author Topic: How do I lock all rotation movement for Parented Camera?  (Read 2900 times)

SammyJoeUK

  • Playmaker Newbie
  • *
  • Posts: 32
How do I lock all rotation movement for Parented Camera?
« on: May 28, 2018, 06:55:33 PM »
Hey guys/girls,

So I'm working on a project where I need the camera following a player character which rotates when moving in a 3d space. I want the camera to follow the movement of the player but NOT rotate when doing so. Is there any way I can lock rotation in all axis?

Thanks in advance

S.

Vanyfraise

  • Playmaker Newbie
  • *
  • Posts: 19
Re: How do I lock all rotation movement for Parented Camera?
« Reply #1 on: May 29, 2018, 01:56:05 AM »
Did you try cinemachine ?

SammyJoeUK

  • Playmaker Newbie
  • *
  • Posts: 32
Re: How do I lock all rotation movement for Parented Camera?
« Reply #2 on: May 29, 2018, 05:43:30 AM »
I haven't - is what I'm after available in Cinemachine?

kavery

  • Full Member
  • ***
  • Posts: 149
Re: How do I lock all rotation movement for Parented Camera?
« Reply #3 on: May 29, 2018, 10:06:19 AM »
If you create a parent object that contains the player as the child, the child could rotate while the parent does not. If you set it up so the parent does the translating while the child does the rotating, you can follow the parent, or create another child for more flexibility (ie this 'target child' could change positions at key moments). I like to use 'Move To', ignore vertical for the camera follow. If you create a finish event and connect it to itself, the Move To will be perpetual even when you meet the finish distance. You can adjust move speed to add some play in the movements, like maybe the camera is slower and catches up. 'Target Position' allows you to create an offset, to create desired distance between the player and the camera. Use a vector 3 variable if you want this distance to change at certain moments.   
« Last Edit: May 29, 2018, 10:09:51 AM by kavery »

kavery

  • Full Member
  • ***
  • Posts: 149
Re: How do I lock all rotation movement for Parented Camera?
« Reply #4 on: May 29, 2018, 10:08:50 AM »
Also if you did want to add some rotation or looking at the player, you could apply a look at or smooth look at action in conjunction with the move to. 
« Last Edit: May 29, 2018, 01:08:49 PM by kavery »