Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I animate this door? I'm not exactly sure where to start with it.

Asked by 2 years ago

Howdy. Posting noob as well as coding noob here-

I'm trying to figure out a way to animate an opening/closing door, by teleporting the pic related models into and away from a position a bunch of times.

Issue is, I'm not exactly sure how to do that, or where to begin codewise, other than assigning each "frame" of the animation a variable, and calling them back and forth.

How can I do that teleporting thing?

Is there a better way to achieve this desired animation effect?

These are essentially flat textures that I am trying to create an animation out of.

Monkey-tier TL;DR, I'm essentially trying to create an opening/closing door using "animation frames", but I'm not exactly sure how to accomplish this. Please review picrel, and help if you can!

[img]https://media.discordapp.net/attachments/454491193607454731/841630883416506379/unknown.png[/img]

[img]https://cdn.discordapp.com/attachments/454491193607454731/841631113566355466/unknown.png[/img]

[img]https://cdn.discordapp.com/attachments/454491193607454731/841631280327557120/unknown.png[/img]

note: the script is currently empty, because I'm not exactly sure where to start with something like this.

0
you *can* use scripts but if you are just starting off, use the built in animation editor or this plugin that I like to use (there are a lot of editors to choose from). https://devforum.roblox.com/t/getting-started-with-moon-animator-2-unofficial/476330?u=speedmask. making keyframes though scripts is mostly for creating your own editor. you shouldn't have to use any scripts except to play them. Speedmask 661 — 2y
0
You can use the Dev Forum or Wiki to know what stuff you need. It won't show you everything you need though. a_crazyjester 21 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

The best way to achieve the animation effect is by using Tween Service. It is very simple to use. Here's how it it goes:

--I'm only showing on opening the door.
--You can add debounce and another CFrame to set both open/closing
TS = game:GetService("TweenService")
Part = _______________ -- The door main opening/closing part
OpenPos = ____________ -- The CFrame the door will go to open
Time = __ --The time in seconds it will take to open the door

goal = {CFrame = OpenPos} -- Setting the Goal for tweening
info = TweenInfo.new(Time) -- Setting the Time for tween
Tween = TS:Create(Part, info, goal)

Tween:Play() -- Call this anytime to run the opening tween

I'm not sure what exactly you mean by Animation Frames, but I'm sure that TweenService is the best way to animate parts in the workspace.

0
I'm not entirely sure my question is comin across correctly. In the image link posted, we have several models, each of those models representing a certain stage in the door's opening process (frames, essentially), and I am trying to figure out a way to use those to create an 'animation' of it opening. My only current idea is that I could teleport pieces in and out of place with 'while' loop. FelixKilo 0 — 2y
Ad

Answer this question