Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetEntityBoneIndexByName returns -1 for model "vw_Prop_VW_LuckyWheel_02a" bone "Base_Pivot" #3074

Open
gigsta12 opened this issue Jan 17, 2025 · 0 comments
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action

Comments

@gigsta12
Copy link

What happened?

I'm trying to get the bone index Base_Pivot from the lucky wheel model vw_Prop_VW_LuckyWheel_02a using GetEntityBoneIndexByName. Currently the bone index is always returning as -1.

Expected result

The bone index should be returned rather than -1.

Reproduction steps

I've tried

  • Testing this on a blank fxserver
  • Checked in blender and confirmed the bone exists
  • Checking in Codewalker, I can see the bone array and the bone within including the index, tag etc
  • I've also tried GET_ENTITY_ARCHETYPE_NAME and confirmed the name is correct
  • Calling _GET_ENTITY_BONE_COUNT returns 0

You can replicate the issue using the below

local LuckyWheelModel = 'vw_Prop_VW_LuckyWheel_02a'
local LuckyWheelEntity = nil

RegisterCommand('test', function()
    if DoesEntityExist(LuckyWheelEntity) then
        DeleteEntity(LuckyWheelEntity)
    end

    local playerCoords = GetEntityCoords(PlayerPedId())

    RequestModel(LuckyWheelModel)
    while not HasModelLoaded(LuckyWheelModel) do
        Wait(10)
    end

    local object = CreateObjectNoOffset(LuckyWheelModel, playerCoords, false, false, false)
    while not DoesEntityExist(object) do
        Wait(10)
    end

    LuckyWheelEntity = object
    SetModelAsNoLongerNeeded(LuckyWheelModel)

    local boneIndex = GetEntityBoneIndexByName(LuckyWheelEntity, 'Base_Pivot')
    print('boneIndex', boneIndex)
end, false)

AddEventHandler('onResourceStop', function(resourceName)
    if (GetCurrentResourceName() ~= resourceName) then
      return
    end

    if DoesEntityExist(LuckyWheelEntity) then
        DeleteEntity(LuckyWheelEntity)
    end
end)

Importancy

Slight inconvenience

Area(s)

FiveM

Specific version(s)

FiveM, Server 12255 Windows

Additional information

No response

@gigsta12 gigsta12 added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

1 participant