playMaker

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

hoyoyo80

  • Full Member
  • ***
  • Posts: 136
Cinemachine camera reposition with PM
« on: April 08, 2019, 10: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: 15500
  • Official Playmaker Support
Re: Cinemachine camera reposition with PM
« Reply #1 on: April 09, 2019, 02:55:30 AM »
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

  • Full Member
  • ***
  • Posts: 136
Re: Cinemachine camera reposition with PM
« Reply #2 on: April 09, 2019, 11: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, 11:31:16 PM by hoyoyo80 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Cinemachine camera reposition with PM
« Reply #3 on: April 11, 2019, 02:30:33 AM »
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