playMaker

Author Topic: Cinemachine camera reposition with PM  (Read 126 times)

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Cinemachine camera reposition with PM
« on: April 08, 2019, 07:31:15 PM »
Hi all 8)

Im trying cinemachine to track my player that is kind of like 3rd platformer(Super Mario 64) view.

In Cinemachine,i use Simple Follow With World Up mode and work just like i wanted. In this mode,when the player move toward the camera, the camera will not rotate an this is fine for me.But i want to use a button that when pressed will reposition itself behind the player again.

How can i achieve this. Thanks:)


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14035
  • Official Playmaker Support
    • View Profile
Re: Cinemachine camera reposition with PM
« Reply #1 on: April 08, 2019, 11:55:30 PM »
Hi,

 Never done it, but I think theses potential solution. I would ask on Unity forum as well.

- create two cinemachine camera, one that rotates with the player and one that doesn't, then you switch from one to the other when you press that button, once the camera has rottated behind the player you can switch back.

- control the camera rotation directly yourself, using playmaker, have you tried that?

Bye,

 Jean

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 56
    • View Profile
Re: Cinemachine camera reposition with PM
« Reply #2 on: April 09, 2019, 08:24:59 PM »
Thanks for the reply 8)

I manage to do what i want but it look jumpy or sudden change :P

What i do incase someone search for the solution.

1.create empty and make it a child of the player, positon somewhere closer to the initial camera position.
2.in FSM, wait for key, deactivate the camera, get position of the empty, set position of the camera, activate it back.
(ive learn u cannot change position or rotation of the camera by action while its active)

I thought of having 2 camera and switch between em to have a smooth transition. Anyone have other method?

Thanks
« Last Edit: April 09, 2019, 08:31:16 PM by hoyoyo80 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14035
  • Official Playmaker Support
    • View Profile
Re: Cinemachine camera reposition with PM
« Reply #3 on: April 10, 2019, 11:30:33 PM »
Hi,

 smooth transition is possible with cinemachine ( I assume both your camera are cinemachine).

https://docs.unity3d.com/Packages/com.unity.cinemachine@2.3/manual/CinemachineBlending.html

Bye,

 Jean