Need info on how to make my person not walk through walls

Where could i find out how to implement this?

redirecting is always good  :smiley: i dont really like the move then fix thing

the thread title is contradicting. detecting the wall is simple (just call findCollisions on your node) - but making the actor behave properly is a science.

There is a difference between collision detection and collision avoidance. You want the second. There are many techniques for this, one is very simple, just don't allow movement that would result in a collision (move, detect and if colliding, update position to old one). But is has some usability problems… Further techniques use physics and walls as repellent strings to characters, and stuff like that.

i use move, then fix, then fix, then fix, then fix, then fix, then fix thing (6 times maximum).

HamsterofDeath said:

i use move, then fix, then fix, then fix, then fix, then fix, then fix thing (6 times maximum).


wow....

i use check, try redirect, move or do nothing.

i thought about using some kind of "try different directions, use the nearest one (compared to the wanted direction) that works"-algorithm, but the thought of having non-exact results (or having to cycle through a near infinite amount of directions to find the best fitting one) didn't please me.

my 6 "then fix"-es are made of 1 rough estimation which puts the object somewhere INTO a wall if it passed through one, and the next 1 to 5 corrections finetune its position to make it align perfectly to any wall it touches. feels exactly like any FPS out there, so i guess we kind of invented the same algorithm.