How to make a sit animation with a model

sorry about the errors. let me review the pictures you sent:
everything seems to be working well, except the fact that in the

if humanoid.Sit = true

it should be 2 = signs. I get confused with that :sweat_smile:
Check the red lines under the errors to see what’s the error. You would probably know how to fix it by then.

If it doesn’t work, would you mind showing the errors in output?

doesn’t seem to be working

a1f4d4f489726262b7f5440dcf12e1e2

No errors in the output at all

Like when i sit a random item such as a phone will appear in my hand and a custom sit animation will play, that’s pretty much what i’m going for.

Did you notice I put

--rest of code

The – part means it’s a comment or something telling you what to do/how the code in that specific part works. If you don’t put the position, It won’t show. If it doesn’t work, try changing the parent to workspace or something.

Does position mean where the model will spawn? such us the hand? Or like Workspace or ServerScriptService. Also i’m pretty new to scripting, sorry about that, i know how to edit scripts and form small scripts, that’s about it

Yes, the position is where it will be. Edit: just so you know, in scripting people use Vector3 for coordinates. (eg. Vector3.new(x, y, z) )

This pretty much what i’m wanting to achieve, sitting with a custom sit animation and a model spawns in your hand, and it not being a tool that i pulled out to show lol, and when you get off the seat it despawns pretty much, pretty hard to explain.
466bd8a6faed9334c6d4ea1ed8f35b6a

Okay, i’ll do that real quick.

How would i be able to position that to the right hand? sorry for the pain.

Wait, i didn’t see the edit, i’ll try that

It’s fine. what you want to do is find the position of the right hand. Make the x and z position a variable, and set the x and z of the item to the variable minus (or plus) a small number to make it look like he’s holding it instead of it clipping with the hand.

So how i getting the cord of the right hand is clicking play, activating the sit anim and once that happens i got into explorer and find my player and find the right and and copy the position it’s currently in?

If so these should be the cords of the right hand -91.428, 82.479, 33.413

I’m getting a bit frustrated right now. The y should probably stay the same, and test if either the x or z should be different. subtract the x/z of the phone’s coordinates from the hand OR vice-versa. then make it a variable (the variable should be the difference of the equation) now you want to do either this:

itemClone.Position = Vector3.new(righthandx* (the right hand's x position) + differencevariable, y position, righthandz* (the right hand's z position ) + differencevariable) -- the * means that it can be either one of the 2

or

itemClone.Position = Vector3.new(righthandx* (the right hand's x position) - differencevariable, y position, righthandz* (the right hand's z position ) - differencevariable) -- the * means that it can be either one of the 2

use the right hand position + variable if the item’s position you want is larger than the hand’s cords and the right hand cords - variable if the item’s position you want is smaller than the right hand cords.
NOTE: This only works if you set a primary part to the model.

Sorry to hear that man, yeah, i’ll try this, like i said i don’t know much in scripting besides making simple scripts and variables, i’ll be sure to credit you if it works or not, which i hope it does

Diner - Roblox i think you found how to do it.

I don’t know if you are still trying to do this, but I learned how to do it partially from this: How to animate Tool Parts (Guns, Knifes etc.)

To explain it in my own words, you essentially attach the object/objects you want to animate to a rig, and animate them as you would normally, then when you are setting up the player to animate, you create a new motor 6d object, and set its attachment0 to the player and its attachment one to the main part of the object (like the handle). If the object attached to the player in multiple places (like a pair of wings) you would potentially have to do this multiple times. I did this in a tool I made, and I will show you the part of my script that does that:

tool.Equipped:Connect(function()-- in your case, when the player sits down.
equipped = true
M6D = Instance.new(“Motor6D”)–creates the motor 6d object
M6D.Parent = script.Parent.Parent:FindFirstChild(“UpperTorso”)–places it inside players torso
M6D.Part0 = script.Parent.Parent:FindFirstChild(“UpperTorso”)–sets its part 0 to its parent
M6D.Part1 = handle–sets its part 1 to the handle of the tool (I defined this variable earlier

fallAnimation:Stop() --I defined my animations earlier in this script
IdleAnimation:Play()

end)

After the player gets up, you would simply destroy that motor 6d, This would happen every time they sat down, and every time they got up. The script I have showed here will not work for you because of the fact that it is a tool. In your situation it would be a bit more difficult, since you would have to have the object stored in something like “Replicated Storage”, make a clone of that object, parent that object to the player that is sitting down, and then create the motor6d that binds them together. I don’t know if you have experience creating rigs, but having knowledge about that sort of thing is essential here.

I found this post while looking for a way to animate players sitting in seats, so I am happy that we both seem to have the opposite problems. I don’t know if you have already solved this after all this time, or if you are even still working on this, but good luck.

I don’t know if you still need help with this, but I found an easy way to do this, just put the seat and the part you want to appear in one model, and then add a script that makes the part visible when the player is sitting. Probably not the best way and it might be complicated to match the part with the animation but yeah.