Roast me, but... I got problems with my terrain

you need use TerrainCollider.

Hey, Koei! Thanks for the reply!

I took your recipy and added Terrain Collider to the terrain

the tray still has its plane collider and rigid body in place

but now it will be still and not fall into the ground

note that I already turned on the Use Gravity feature

should I add any other component?

Sorry, I don’t know what you want to do next.

just to make the tray drop down to the floor

Maybe you need BoxCollider instead of PlaneCollider

useful information

You should take a look at a tutorial I wrote for a first person camera. It explains how to set the physics.

Also, if you wish to use your own model and not the terrain. Use mesh collider instead of terrain collider. You have to select the mesh in the list which will be named the same as the model in blender, which might be cube if you didn’t rename it.

1 Like

BoxCollider on terrain? I tried that, the tray falls down, but goes through the terrain, doesn’t stop on the floor

Nice tutorial, I will try it. I tried using meshCollider, but still the tray falls through the floor. Still checking for solutions.

UPDATE

This is how I set my Terrain (I called it “Piso”)

I checked some tutorials online and in this forum, and this is the recommended setup for terrain.

But still:

The tray drops beyond the ground.

How can I make the floor hard? am I missing something?

You have to choose the right mesh for the mesh collider as there are many meshs to choose from. It’ll be named what ever the model is named in blender. You’ll know it’s the right one as it will highlight the models edges in green.

I also do recommend following the tutorial first as you’ll see it working and be able to adapt it to work with your model from what i’ve said.


NewProject_14.zip (37.4 KB)

should I add some properties to Collision.terran asset?

I changed as indicated, but the issue persists…

any mesh will work?

Any mesh should work. Like I said due to the list of the meshs you get to choose from (this includes other models in the scene, maybe even project). It can seem that they are just generic Cube or Plane etc but once you start cycling through you will see the mesh highlighted in green. If you didn’t change your models name in blender it may be named Cube or Plane depending on the shape your model started as. Which is what threw me off atleast in finding the right mesh at first and thinking mesh collider didn’t work as expected.

I think the terrain is set up correctly but now it is the collider for the tray that might be the issue.

Hey, iDev! I saw your twitter and your website. Looks really nice!

I made my project again from scratch, following your tutorial.

However, I cannot still solve the mystery: how to make the capsule to stand in the ground and not to fall down.

Here my set for the terrain, maybe there is where the problem is?

https://game-1258223435.cos.ap-guangzhou.myqcloud.com/mingame/FPS/web-mobile/index.html

PlayerControl.zip (7.3 MB)

You can refer to the approach in this project.

Looking at the picture I can’t seem to see the player capsule. Make sure your player capsule is above the terrain. I believe if it is sitting a little bit through the terrain it’ll pass straight through it. Make sure it is sitting above the terrain and it should drop onto the terrain. Also thanks, you should check it out more when you are ready to release a game.

Hey there! It’s me again!

Here I placed the capsule a bit higher. Also I noted on @zzf520 demo that terrain only included cc.Terrain and cc.TerrainCollider (rigidBody seems to be included inside Terrain Collider). But still the capsule is sinking into the floor.

My solution: add a Plane and place it over the Terrain, and implement planeCollider and rigidBody2D > Static. It will only work on flat surfaces, but I guess it’s a start. That way the capsule won’t fall into the void:

Sincere thanks to @Koei @iDevGames @zzf520 for their help!

Not a problem. Now you can see it working hopefully we can get the terrain working too. I noticed from your first screenshot that the terrain has the terrain collider but I don’t see a rigidbody on the terrain. For the terrain collider to work you will also need a rigidbody component added to the terrain also. This rigidbody unlike the player needs to be set to static as the terrain won’t move unlike the player capsule.