D
D
durnevdanya2017-05-06 15:58:02
Game development
durnevdanya, 2017-05-06 15:58:02

How to make a script to pass obstacles, like in this example?

Good afternoon, in MagicaVoxel I created a single labyrinth model under Unity. Next, I added a picture of a rhombus. Imported, that's what happened.
3iJvaFCN3HU.jpg
My question is, I can make a rhombus move, but it will be possible to pass through obstacles (walls), but how can I make it exactly a labyrinth, so that I need to go around the walls, but you can’t go through them? I thought that we need a Box Collider, but this model is the only one, it will not be possible to make the walls separately there solid. How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Gaydak, 2017-05-06
@durnevdanya

There is (as TheTalion already pointed out ) Rigidbody
There is also MeshCollider, which will make you a collider according to the shape of the mesh.
But there is a problem in that the mesh Collider in terms of performance and "adequacy" is a bad idea.
Here's another link to the manual, there about gluing colliders, which interact with each other and other useful things .
In fact, it would be good practice to make walls for your labyrinth out of primitive BoxCollider, they will still be static for you and "stick together in the scene", so there should be no problems with performance.

T
TheTalion, 2017-05-06
@TheTalion

https://docs.unity3d.com/ru/current/Manual/class-R...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question