Yue Posted May 11, 2025 Posted May 11, 2025 Any suggestions please. Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 11, 2025 Author Posted May 11, 2025 This is the best I have been able to understand, but the character, when turning on the ground, jumps. function this:AlignBoneToBody(bone, body) if bone and body then -- Obtener rotación del cuerpo en coordenadas globales local worldRot = body:GetRotation(true) -- Convertirla a coordenadas locales del jugador local localRot = TransformRotation(worldRot, nil, model) bone:SetRotation(localRot, true) -- Obtener posición del cuerpo en coordenadas globales local worldPos = body:GetPosition(true) -- Convertirla a coordenadas locales del jugador local localPos = TransformPoint(worldPos, nil, model) bone:SetPosition(localPos, true) end end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Karadag Posted May 12, 2025 Posted May 12, 2025 I've experienced similar things. I think I get better results when I do rotations as quaternions. 1 Quote
Yue Posted May 12, 2025 Author Posted May 12, 2025 In other words, I have to create the equivalent of TransformRotation but in Quaternions? I'm really blind in this because I don't understand very well. Do you have any code that can help me for that please. Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted May 12, 2025 Author Posted May 12, 2025 I have better rotations, but the body is stretched: S function this:AlignBoneToBody(bone, body) if bone and body then -- Obtener posición del cuerpo en coordenadas globales local worldPos = body:GetPosition(true) -- Convertirla a coordenadas locales del jugador local localPos = TransformPoint(worldPos, nil, model) bone:SetPosition(localPos,true) -- Obtener rotación del cuerpo en coordenadas globales local worldRot = body:GetQuaternion(true) -- Convertirla a coordenadas locales del jugador local localRot = TransformRotation(worldRot, nil, model) bone:SetRotation(localRot:ToEuler()) end end Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Karadag Posted May 13, 2025 Posted May 13, 2025 Of course I want to help. Just give me a few days to complete it. You don't need to use :toEuler() you can use quaternion to SetRotation().. Also I never used TransformPoint and TransformRotation. I made the whole ragdoll a child of a pivot and took the transforms locally and applied them to the skeleton locally. Quote
Solution Yue Posted May 13, 2025 Author Solution Posted May 13, 2025 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Karadag Posted May 13, 2025 Posted May 13, 2025 It looks good now. Can you figure out what the problem is? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.