PlayMaker Help & Tips > VR Help

Move in the direction of where you are looking

<< < (2/4) > >>

wuannetraam:

--- Quote from: jeanfabre on April 30, 2020, 01:17:16 AM ---Hi,

 to get the direction of the camera, use TransformDirection action on the local z axis, that will give you the world direction that the player should move to so when you translate your player, you use that as the base.

Does that make sense?

Bye

 Jean

--- End quote ---

Thanks for your advice. Im not sure if what I'm doing with "TransformDirection" is the correct way as you mean it. I've tried it this way but that gives strange results (see image below). What am I doing wrong?

LordHorusNL:
Hey Maarten.

This is an easy fix. The "transform Direction" actions control where the player is heading in the scene.

In my package example scene, add a new variable named "DirectionObject" and expose it to the inspector so it sits just bellow the controller variable in the inspector window. Drag your camera into that new variable.

And then change the game object variable on both "Transform Direction" actions to "Directionobject".

Now your CameraRig should move in the direction you are looking in and it still uses your preferred controller for touch pad input.

That's it, let me know if you still have problems.

*Edit*

I've also updated the package in the post above so you can just re download that.

wuannetraam:
LordHorusNL thank you so much for taking the time! If I test your package and move my character it moves with like 1000 miles per hour over the ground. I've tried to change Add Force -> Force Mode from Velocity Change to Force. But then it doesn't move anymore. Any idea what is going on? I can't really test your setup becouse of this.

Thanks
Maarten

wuannetraam:
got everything working. Changed Add Force to Force and added a Vector3 multiplier to increase speed. 

Thank you very much.

LordHorusNL:
Good to hear you got it working, the package was setup mainly for basic translation movement so i'm not surprised you had to change some things.

Welkom bij de PlayMaker familie landgenoot. :P

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version