Hi guys, I have created object model in blender and it looks like this
Then, I have created an animation to be able to open the lid in game
In codewalker (rpf explorer) everything works fine, but after I streamed the object and the animation into the game I’m not able to play the animation on the entity. It’s just there and nothing happens
That’s the code I’m temporary using to spawn the object and to play anim:
RegisterCommand("case", function()
local model = `strikezone_case` -- gta object: xm_prop_x17_chest_closed
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(10)
end
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local object = CreateObject(model, coords.x, coords.y, coords.z, false, true, true)
SetModelAsNoLongerNeeded(model)
PlaceObjectOnGroundProperly(object)
local animDict = "clip@strikezone_case" -- gta anim: anim@treasurehunt@hatchet@action
while not HasAnimDictLoaded(animDict) do
RequestAnimDict(animDict)
Citizen.Wait(10)
end
PlayEntityAnim(object, "opening", animDict, 1000.0, false, true, false, 0.0, false) -- gta anim name: hatchet_pickup_chest
print(GetAnimDuration(animDict, "opening")) -- prints 1.0 (and that's the actual time of the animation so it's correct)
Citizen.Wait(5000)
print("done")
DeleteEntity(object)
RemoveAnimDict(animDict)
end)
I also checked the code with gta’s object and gta’s animation - everything worked fine.
To create object & animation I used Blender 3.6 with Sollumz 2.1.
Does anyone know what may cause the issue?