[Unity + Oculus] Player going through the floor

[Unity + Oculus] Player going through the floor

by Sébastien Gachoud -
Number of replies: 9

Hello,

I have a terrain with a mesh collider and an object with a mesh collider. My player (I used an OVRPlayerController) falls through the terrain but not through a floor made out of a cube with a box collider. The object also falls through the floor I made on the oculus but not when I run the game with unity.

I set 0.01111111 as time step in the build setting.

Does anyone have a lead to fix this?

All the best 

In reply to Sébastien Gachoud

Re: [Unity + Oculus] Player going through the floor

by Nana Tian -

Hey,

Could you try to uncheck the Use Profile Data option on the OVR Player Controller Script?

Best,



In reply to Sébastien Gachoud

Re: [Unity + Oculus] Player going through the floor

by Mathias Guy Delahaye -
Good afternoon,

If you have a screenshot of your Terrain in the inspector view it might help us to
get a bit more context to provide a more accurate answer.

Did you managed to get your character on your scene without this issue previously ?
If yes : what are the changes since the last revision ?

If not :
Have you checked that the terrain is not flipped (rotation of +/-180 for x or z ) ?
Is the Terrain Collider present ? Enabled (idem for all parents game objects until the root of your scene) ?
Is the problem still present if you disable all of your scripts (e.g. is one scripts disabling the gameobject containing the terrain) ?
Is your character bellow the terrain at the beginning of your scene ?

Otherwise you can also try to copy / paste an example from the hands-on about locomotion
onto a blank scene to have a clear comparison between your scene with the issue and the
example to find the difference and fix your issue.

Stay safe, good luck and Happy Easter,

Mathias
In reply to Mathias Guy Delahaye

Re: [Unity + Oculus] Player going through the floor

by Sébastien Gachoud -

Hi,

Here is a screen shot:

I made this room where I can safely walk and when I let the player drop on the outside ground, which is below the room, I fall through the ground. I tried with a mesh collider, I tried with the terrain collider, I tried both, I tried to place the ground at the root of the scene and I tried to remove my scripts from the player. Any ideas left =/

Thank you, Happy Easter

In reply to Sébastien Gachoud

Re: [Unity + Oculus] Player going through the floor

by Mathias Guy Delahaye -
In your Ground_01 Gameobject, your Terrain Collider don't have a source for the Terrain Data field.
Thus there is no way for this component to get the shape of your terrain.

You must fill this field with the terrain data used to generate the terrain surface.

Mathias
In reply to Mathias Guy Delahaye

Re: [Unity + Oculus] Player going through the floor

by Sébastien Gachoud -

Indeed, thank you. Unfortunatly I don't have terrain data for this mesh. Could it simply work with the mesh collider?

All the best

In reply to Sébastien Gachoud

Re: [Unity + Oculus] Player going through the floor

by Mathias Guy Delahaye -
In principle, you can't have a terrain without a Terrain Data file in your project (or at least I am not aware of it).
Thus you should search in your project repository for a file with a name like "New Terrain" with the .asset extension.

Mathias
In reply to Mathias Guy Delahaye

Re: [Unity + Oculus] Player going through the floor

by Sébastien Gachoud -
This because it is not a unity terrain, it is just a mesh. I guess I will make a terrain by myself. 

I also have an object with a mesh collider with a rigidBody attach to it. It goes straight through the floor of the room when I run the game on the oculus but stays on the floor when I run the game with unity, do you have any idea about that?

(btw I don't expect imediate answer, I know it is a holyday) 

Thanks for your help!
In reply to Sébastien Gachoud

Re: [Unity + Oculus] Player going through the floor

by Mathias Guy Delahaye -

Well in this case don't use Terrains and associated types.

If you are using a mesh, be sure that the mesh is on the right side (if the mesh is reversed it may induce unexpected behavior)

For the behavior difference between Unity and the Oculus Quest a bit more details would be better.

For instance, your GameObject may be attached in some way to your player.
Thus you won't see any changes in Unity as the OVR is not attached to the HMD whereas it is when it runs on the Quest.

Mathias