whorse Posted September 20, 2015 Share Posted September 20, 2015 (edited) Is there any way to get which ped bone is at a specific set of coordinates? I have my gravity gun which uses raycasting to return the coords of the exact spot (bone) that it hits the ped at, and I can use that to set the offset relative to the ped's core coordinates. That way, I can pick the ped up and hold it from that same spot the whole time. However, once the ped goes ragdoll, the bone/limb that I originally hit will swing around wildly while the original offset-coords will stay at the same (now empty) spot where the bone used to be. I noticed there is a native called: static Vector3 PED::GET_PED_BONE_COORDS(Ped ped, int boneID, float x, float y, float z) but it requires that you use the boneID of the bone you want in order to work correctly. I have tried using 0 as boneID and different offsets and world-coords as the xyz, but at best it only works as well as my original method (the ped just spins around wildly; it should be dangling by the bone it was picked up from) . How can I retrieve the boneID without shooting the ped and saying "GET_PED_LAST_DAMAGE_BONE"? Is there any kind of uber-weak invisible laser damage or something that I can apply to the ped bone, without having to actually aim a weapon (and without getting a wanted level for doing it)? Thanks Edited September 20, 2015 by whorse Link to comment Share on other sites More sharing options...
Jitnaught Posted September 20, 2015 Share Posted September 20, 2015 I would loop through all of the bone indexes and get the coords of each one. After that check which of the coords is closest to ped core offset, and then use the bone index that is closest. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now