How can I animate a part

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to be able to make my part play an animation whenever I want it to.
  2. What is the issue? Include screenshots / videos if possible!
    No idea how I can do it
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    devforum, youtube,experimenting
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
4 Likes

That’s a very vague description. Please give us more information.

Where is the part? Examples are in the workspace, in a weapon, attached to a player.

What kind of movement/animation do you need? Examples: straight line, rotation, or 3D movements.

How are you implementing the animation? With a script? With a key press?

I just want to have my part do a little rotation animation, not using tweenservice, an animation, its a part parented to workspace, a literal part.

1 Like

You can’t do an animation without a character rig (Model + Humanoid + HumanoidRootPart + Motor6D + rig bones)… The only solution for you is to use TweenService or CFrame rotation via a script.

And how can I find the ratio of the players screen size, Unrelated, but still a question, like 12:6 or 16:9. That kind of thing

Use an AnimationController, basically allows you to animate something that isnt a Humanoid.

camera.ViewportSize should return the size of the player’s screen

I want the aspect ratio, That was my question

You can use this in a local script, it is the size in pixel of the Roblox Player window.

workspace.CurrentCamera.ViewportSize

Aspect ratio is what I want. :frowning_face:

How exactly would I do this, I’m not sure

You can’t get the aspect ratio dirrectly, you are only able to get the window or the whole screen size in pixel, then you have to determine the ratio by yourself using this.

They said an animation for a single part, AnimationController require a Model and a Motor6D which also require 2 base parts.

And How do I make a motor6d? and one I’ve made it what do I parent the animationcontroller to? and then what do I do?

Check the link that Cairo shared, everything is explained in there.

You keep using the term animation, but I think you should just be using the simpler term rotation. An animation is a specific control setup in Roblox. A rotation can be done many ways, and much easier than an animation.

Is the Part Anchored, or is it unanchored?

If it’s unanchored you can:

  • If you just want it to rotate less than a full circle you can use a HingeConstraint set to Servo. A script can just change the TargetAngle.

  • If you want to spin a Part a bunch of times with no set orientation you can set the HingeConstraint to Motor.

  • You can also use a Motor or a Motor6D to do the same thing. It doesn’t need a Humanoid, just script the DesiredAngle.

  • You can use an AlignOrientation to change it’s Orientation according to the Workspace.

  • You can use a Weld and change C0 or C1 orientation of the weld.

If it’s Anchored you can Tween or Lerp the CFrame of the Part to get it to rotate.