B
B
Bogdan Panchenko2019-11-23 14:25:05
C++ / C#
Bogdan Panchenko, 2019-11-23 14:25:05

Why does an object go through walls?

5dd917064ca7d570259505.png
5dd91694d677c288965308.png5dd916a14cc11706389640.png
The walls have Box Collider 2d , as does the player.
What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GFX Data, 2019-11-23
@ShockWave2048

You cannot move physics through a standard transform component.
Add a rigid body and move through it - Rigidbody.MovePosition(), or better by adding a movement impulse - rb2D.AddForce(transform.up * thrust, ForceMode2D.Impulse);
https://docs.unity3d.com/ScriptReference/Rigidbody...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question