Jump to content

'bodyPart' IDs for onClientVehicleCollission


J.S.

Recommended Posts

I'm just wondering if anyone has a list of the bodyPart IDs returned by onClientVehicleCollision. There doesn't seem to be any documentation on this and using debug lines doesn't seem to be helpful as it is just continually returning 0's. So if you do have the IDs, please do share as it's fairly important to what I'm working on. Thanks

Link to comment

I think he's talking about the vehicle body parts, not the ped body parts. The best way I found to check this is to write a simple script that outputs what body part you hit in the chat, so you can check where on the car these parts correspond to.

addEventHandler("onClientVehicleCollision", root,  
function(element, force, part) 
    if element then 
        if getElementByType("vehicle") then 
            outputChatBox("Body part was "..part) 
        end 
    end 
end 
) 

As for the body parts themselves, it seems pretty difficult to tell where they are. Hitting a car head on will often trigger 2-3 body parts at once (i think they were 1,3 and 17).

EDIT: you might also want to remove that if statement "if getElementByType("vehicle") then", as that is in there to make it only trigger when hitting other vehicles.

Good luck!

Link to comment
  • Moderators

The reason for that is that you can't hit arms with a vehicle. Arms don't have collisions for vehicles or objects.

Just like many other bodyparts.

Maybe you noticed this: When you go sprint against a wall, 40% of your head is in the wall.

Well here is one with a car ^^

http://img708.imageshack.us/img708/8164/4w9i.png

-------------------------------------------------------------------------------------------

On the other hand everything can be calculated.....

collisionX/Y/Z: the position the collision took place

normalX/Y/Z: the surface normal of the hit object

getPedBonePosition 
getDistanceBetweenPoints3D 
-- or 
processLineOfSight 
  
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...