[Pawn] Vehicle collision with object - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Vehicle collision with object (/showthread.php?tid=2533) |
Vehicle collision with object - illiker58 - 2023-12-29 Hello everyone! I'm having difficulty finding a solution to detect collisions for a script to launch rockets from cars. Initially, I chose to check for collisions using IsPlayerInRangeOfPoint, but it's very imprecise. Currently, I'm looking for a solution to determine if the missile object can be intercepted as a collision with a vehicle. I was thinking of an invisible collision box around the vehicle. Do you have any advice on detecting collisions between an object and a vehicle? Thank you. RE: Vehicle collision with object - aguadecoco1301 - 2024-01-27 Maybe raycast of ColAndreas can help you. RE: Vehicle collision with object - N0FeaR - 2024-03-03 Here's a basic outline of how you can implement this: Create the rocket object when fired from a vehicle. Track the movement of the rocket using OnPlayerObjectMoved. Check for collisions between the rocket and nearby vehicles in the callback. Here's an example code to demonstrate this: PHP Code: forward OnPlayerObjectMoved(playerid, objectid); |