Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make GameObject (Terrain,etc.) collides with Entities #180

Open
Matrixchung opened this issue May 17, 2020 · 2 comments
Open

How to make GameObject (Terrain,etc.) collides with Entities #180

Matrixchung opened this issue May 17, 2020 · 2 comments

Comments

@Matrixchung
Copy link

@Matrixchung Matrixchung commented May 17, 2020

I have tried it before in
https://docs.unity3d.com/Packages/com.unity.physics@0.3/manual/getting_started.html
But I found that if I add the Convert to Entity and Physics Shape component to Terrain , it will totally disappear while Cube or Sphere do the Conversion in a right way.
My Blocks' EntityArchetype has the following tags: Rotation,RenderBounds,Translation,RenderMesh,PhysicsCollider,LocalToWorld and PhysicsVelocity.
If I create a simple Cube which will be converted to entity, it all works fine with all blocks bouncing on the surface.But when it comes to Terrain (only without entity conversion can I see the rendered Terrain), they just go though the terrain and don't make any collisions.
Can anyone tells me how to make my entities collide with Terrain?

@snakenjah
Copy link

@snakenjah snakenjah commented Sep 24, 2020

@Matrixchung here is a link to the answer and the code used to do it, it's not a nativ solution, its using low level api https://drive.google.com/drive/folders/1xMqXOHUlsNorgt_Opymeaj4AmTUiODAu?usp=sharing
your welcome
I took it from this tread on Unity forum : https://forum.unity.com/threads/using-unity-terrain-with-dots-workflow.755105/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.