playMaker

Author Topic: Rewired and movement relative to camera  (Read 941 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Rewired and movement relative to camera
« 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
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Rewired and movement relative to camera
« Reply #1 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.

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: Rewired and movement relative to camera
« Reply #2 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.

Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
Re: Rewired and movement relative to camera
« Reply #3 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.
« Last Edit: December 22, 2020, 06:13:22 AM by IIKII »
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio