Collision Detection?
#1

so i have been trying to find a way to make the objects i move crash into(either stop or explode) when they hit something like a building wall ...but the pass thru i can make the stop and explode just fine on timers and distance formulas but they pass thru the wall first ...any sugestions on a way to detect collisions? please and thank you
Reply
#2

Quote:

...but the pass thru i can make the stop and explode just fine on timers and distance formulas but they pass thru the wall first ...any sugestions on a way to detect collisions? please and thank you

The only way to prevent this is when you would have the diameter of the object, or the actual object size. Since you don't have either (only the middle X, Y and Z coordinate) I don't think this would be possible. If you only use 1 type of object you may determine it's diameter through trial-and-error, but that wouldn't be at all dynamic.
Reply
#3

it is more of a custome weaponry project for an arena FS i made so the objects will be shot from different locations they blow up near players but pass thru walls ...i can map out each wall ...but i would like a universal fix for collision if i want to place it in a new int
Reply
#4

Theres no universal method. If the walls are custom placed objects, you need to check the collision for each of them. A good and quite efficient way would be using planes. I once wrote about how to realize collision detection with planes, but dont feel like searching my own old post.

Edit: Here it is: http://forum.sa-mp.com/showpost.php?...5&postcount=18
Reply
#5

i think you are talking about if they are solid and you can walk thru them? i mean when the moving object touches them for it to detect that it hit a wall and bounce/explode/stick to it i can do all the code for the bounce/explode/stick to it i just dont want to make a clause for each point it can touch saying if object hits these cords turn it around ...just too many walls and points on the wall for that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)