How can I lock the position of my
FirstPersonController
in UrsinaWhen my
FirstPersonController
remains standing, another Entity can go through theFirstPersonController
entity though I used collider. How can I solve that ?
Asked
Active
Viewed 144 times
0

Sami
- 1
- 1
-
What do you mean by locking? Making it unable to move around? Please show your code, otherwise we can only guess. – Jan Wilamowski Feb 12 '22 at 00:32
1 Answers
1
- What exactly do you mean by "locking" ? You can disable a controller with
your_controller.enabled = False
sayingyour_controller
is aFirstPersonController
. - A collider is not a wall, it's just something that can interact with
raycasts
. If you want collision, you must shoot araycast
. If it hits something (anEntity
with acollider
), check if thedistance()
between theEntity
and the origin of theraycast
is below a certain level. Just do something according to the result, like disabling theEntity
. I'd recommend looking atFirstPersonController
's code and globally at samples on the Ursina repository.

DiamondsBattle
- 195
- 13