motorsport71 Posted November 11, 2016 Share Posted November 11, 2016 Hey All. I am attaching a backpack to any pedestrian skin i chose. The problem is once its fixed onto the ped's bone it 'floats'. If you run the bag lags behind, and if you stand still the bag doesn't move while you character sways back and forth at idle. Here's the code: Public Sub AddProp_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode <> Keys.U Then Return Dim bone As Integer = GTA.Native.Function.Call(Of Integer)(Hash.GET_HASH_KEY, "SKEL_Neck_1") Dim bags As Entity = World.CreateProp("prop_michael_backpack", Game.Player.Character.Position, True, False) GTA.Native.Function.Call(Hash.ATTACH_ENTITY_TO_ENTITY, bags, Game.Player.Character, bone, 0.0, -0.18, 0.35, 180.0, 180.0, 0.0, False, False, True, False, 0, True) End Sub Is there a way I can more firmly attach the pack so it looks like the pedestrian is wearing it naturally and not floating around? I know that GTA.Native.Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 9, 9, 0, 2) attaches the pack to Michael but it doesn't work for any other pedestrian because of their unique components. Thanks Link to comment https://gtaforums.com/topic/873226-vbnet-attached-objects-to-peds-floating-around-bone/ Share on other sites More sharing options...
jedijosh920 Posted November 11, 2016 Share Posted November 11, 2016 You have to find the right bone and offsets. Link to comment https://gtaforums.com/topic/873226-vbnet-attached-objects-to-peds-floating-around-bone/#findComment-1069205372 Share on other sites More sharing options...
unknown modder Posted November 11, 2016 Share Posted November 11, 2016 Hey All. I am attaching a backpack to any pedestrian skin i chose. The problem is once its fixed onto the ped's bone it 'floats'. If you run the bag lags behind, and if you stand still the bag doesn't move while you character sways back and forth at idle. Here's the code: Public Sub AddProp_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode <> Keys.U Then Return Dim bone As Integer = GTA.Native.Function.Call(Of Integer)(Hash.GET_HASH_KEY, "SKEL_Neck_1") Dim bags As Entity = World.CreateProp("prop_michael_backpack", Game.Player.Character.Position, True, False) GTA.Native.Function.Call(Hash.ATTACH_ENTITY_TO_ENTITY, bags, Game.Player.Character, bone, 0.0, -0.18, 0.35, 180.0, 180.0, 0.0, False, False, True, False, 0, True) End Sub Is there a way I can more firmly attach the pack so it looks like the pedestrian is wearing it naturally and not floating around? I know that GTA.Native.Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 9, 9, 0, 2) attaches the pack to Michael but it doesn't work for any other pedestrian because of their unique components. Thanks You aren't passing the right argument for the bone parameter. It needs to be the bone index which can be found using Dim bone As Integer = GTA.Native.Function.Call(Of Integer)(Hash.GET_ENTITY_BONE_INDEX_BY_NAME, Game.Player.Character, "SKEL_Neck_1") Link to comment https://gtaforums.com/topic/873226-vbnet-attached-objects-to-peds-floating-around-bone/#findComment-1069205699 Share on other sites More sharing options...
motorsport71 Posted November 11, 2016 Author Share Posted November 11, 2016 Thanks for the help but no matter how I attach the backpack, changing the native and trying various bones, it acts like its following an invisible placeholder for the skeleton. For instance when I climb a wall it will move up before the player and meet the player once the animation has finished. Its almost as if the skeleton doesn't match the characters animation. Link to comment https://gtaforums.com/topic/873226-vbnet-attached-objects-to-peds-floating-around-bone/#findComment-1069205967 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