View Full Version : Collision

30th Oct 2001, 01:38 PM
I'm writing a little something (I don't want to make a joke of myself by mentioning what it actually is and then failing to complete it) and I need to check whether it's currently on top of something else, especially the world geometry. Checking whether Base is None didn't work; neither did tracing downwards a little bit further than the CollisionHeight, the latter logically because the thing could be standing on top of something with only part of its cylinder, but not its center. Can anybody help?

30th Oct 2001, 03:46 PM
It would be easier if I knew what you're trying to do. Is this some object that will bounce around and you need to check if it has landed?

You could try a trace with an extent close to CollisionRadius or something. It wouldn't be completely accurate, but it should work. (I'm not sure, but extent is a vector, so I think it would be like checking collision with a box instead of a cylinder.)

30th Oct 2001, 06:13 PM
It's something that needs to move, keeping to the ground, but for some reason PHYS_Walking doesn't work (perhaps it has to be a pawn for that, but for reasons I don't want to explain yet I don't want it to be a pawn), so I have to switch between PHYS_Projectile and PHYS_Falling. It appears to be impossible to set velocities in anything except PHYS_Projectile.

30th Oct 2001, 06:28 PM
So you use PHYS_Projectile when it's on the ground and PHYS_Falling when it's not? Have you investigated Landed() and BaseChange() functions? I am most likely overlooking something, but I can't quite see your problem. Anyway, try tracing with an extent, if you haven't already.

30th Oct 2001, 06:41 PM
Yes, I've tried Landed and BaseChange. I'm not quite sure when BaseChange is called, though. Anyway, Base appears to be None when the object is resting on world geometry.

31st Oct 2001, 04:00 AM
Basechange() is called by SetBase(Actor) and Landed() is called when Physics is changed from PHYS_Falling to PHYS_None (I think). So you should try checking for PHYS_None or use HitWall() and Touch().