Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: IIKII on December 22, 2020, 04:13:03 AM

Title: Rewired and movement relative to camera
Post by: IIKII on December 22, 2020, 04:13:03 AM
Hi, I need help in figuring out how to get my character move relative to the camera with rewired input axis?

So far I managed to get it moving with getting the axis but cant find any way to let it move relative to the camera.

thanks
Title: Re: Rewired and movement relative to camera
Post by: djaydino on December 22, 2020, 05:43:35 AM
Hi.
Usually its the camera moving relative to the player.

Can you explain the use case.

if for example player needs to slow down when near camera edges, then you need some calculations, for example distance from camera center.

The axis you only use 0 to 1 and then have a variable for speed multiplier.

that speed multiplier you can then adjust depending on the distance from the camera for example.
Title: Re: Rewired and movement relative to camera
Post by: IIKII on December 22, 2020, 05:50:26 AM
Hi.
Usually its the camera moving relative to the player.

Can you explain the use case.

if for example player needs to slow down when near camera edges, then you need some calculations, for example distance from camera center.

The axis you only use 0 to 1 and then have a variable for speed multiplier.

that speed multiplier you can then adjust depending on the distance from the camera for example.

it is for a first person character movement. Originally i am using get axis vector action set relative to the player camera but this doesn't work for rewired.

I am guessing i will need to do it differently if i am using rewired but have no idea how.

Title: Re: Rewired and movement relative to camera
Post by: IIKII on December 22, 2020, 06:08:14 AM
Ah, I managed to got it somehow.

Setting the vector3 x and z with the rewired axis and then using my camera's y rotation for the vector3 y. But now the problem is that I cant find any value that i can use for animating the animator's speed parameter.

Not sure if this is the best way to do it though.