How to recognize a class is touching a wall
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
How to recognize a class is touching a wall
How do I go about checking if a class, specifically the player, is touching a wall? I am using Nash's platformer starter kit, and don't know how to do this, which at the moment is the cause of the biggest issue with my physics atm. The issue is if the player is running against a wall and jumps over it, due to building up speed because the player thing doesn't recognize the wall as putting friction to a stop, the player will bolt over it at whatever speed was built up. What kind of expression (or something else? New to both ZScript and programming proper in general) would I call to help remedy this?
Re: How to recognize a class is touching a wall
The best way to do it would be to fire line traces. AimLineAttack can be used for this. The real problem right now though is that there's no way to detect if the trace result is either a wall, a floor or a thing (there's no way to distinguish uniquely what exactly the trace hit). Graf has said some vague things about scriptified trace results, my best guess is that it's not currently on his priority list.
Another approach (which was popular during the ACS/DECORATE days) is to spawn a "collision checker" every tic - if the Spawn fails, it means something is in the way.
Another approach (which was popular during the ACS/DECORATE days) is to spawn a "collision checker" every tic - if the Spawn fails, it means something is in the way.
Re: How to recognize a class is touching a wall
Hm. Hopefully I can something to work but not being able to tell what the thing is the player touched is going to be a bit of an issue with the way the engine I'm trying to make works. Hopefully I can get something sorted out.