I’m new to unity and here am developing a game for htc VIVE, am using steamvr player prefab in my game and there are some moving platforms by using that player can cross from one side to another. The issue is when player steps on the it he is not moving along with the moving platform he literally stands on the same X position and some How I figured it out that its a issue with player collider. Is there any possibile way to achieve this without using any collider/rigidbody. Open to any idea/solution you guys can come up with. Below is the code which i have used to move the player. Any type of information would be truly appreciated.
In a 2D game I’m working on, I check to see if the player object is ‘grounded’ by firing a ray with Physics.Raycast directly downwards.
If I’m grounded, I store the collider I’m grounded to, and it’s current position.
Then, if remain grounded between frames (ie I haven’t jumped) and the ‘ground’ collider moves at all, I move the player by the same amount. Basically, the player copies the movement of the platform.
Note that in VR, this will most likely need you to place an empty ‘Base’ GameObject that your VR camera rig lives inside. This way you can move the Base object when the platform moves, which will then move the VR camera.
Motion Sickness Warning - Transitioning from being self-propelled to having independent movement like this can make some users feel VR/motion sickness. It might be worth adding some extra visual edges to the platform to make it clear you are riding something.