I don’t know what’s causing this damn bug but it’s constantly happening to me no matter what object I animate no matter what priority or what I disable or don’t. It’s seriously starting to piss me off because I’ve spend almost 2 days fixing this stupid issue with animations.
It’s opening the door 30x stronger ingame than in the actual playback of the animation in studio. Everything is literally rigged and setup correctly
Code doesn’t even want to show up after I edit it on this website.
local Door = script.Parent
local Animator = Door.Humanoid.Animator
local OpenAnimation = Animator:LoadAnimation(script.Open)
local CloseAnimation = Animator:LoadAnimation(script.Close)
local RunService = game:GetService("RunService")
local OpenSound = Door.Door.DoorInner.Open
OpenAnimation.Priority = Enum.AnimationPriority.Action
CloseAnimation.Priority = Enum.AnimationPriority.Action
OpenAnimation:AdjustWeight(10)
local DoorStatus = false
local function Open()
OpenAnimation:Play()
end
local function Close()
CloseAnimation:Play()
end
Door.Door.Handle.ProximityPrompt.Triggered:Connect(function()
Open()
end)
Frame rate doesn’t matter. I’ve used Blender, Roblox’s animator, and Moon animator all on 30 and 60 fps uploading around 6 animations in total only for ALL of them to give me the same results.
local Door = script.Parent
local Animator = Door.Humanoid.Animator
local OpenAnimation = Animator:LoadAnimation(script.Open)
local CloseAnimation = Animator:LoadAnimation(script.Close)
local OpenSound = Door.Door.DoorInner.Open
-- Set animation priorities
OpenAnimation.Priority = Enum.AnimationPriority.Action
CloseAnimation.Priority = Enum.AnimationPriority.Action
-- Ensure animations are at their default speed and weight
OpenAnimation:AdjustSpeed(1)
CloseAnimation:AdjustSpeed(1)
OpenAnimation:AdjustWeight(1)
CloseAnimation:AdjustWeight(1)
local DoorStatus = false
local function Open()
OpenAnimation:Play()
if OpenSound then
OpenSound:Play()
end
end
local function Close()
CloseAnimation:Play()
end
Door.Door.Handle.ProximityPrompt.Triggered:Connect(function()
if DoorStatus then
Close()
else
Open()
end
DoorStatus = not DoorStatus
end)
This won’t work either, I highly doubt it could be a scripting issue due to the fact that no matter how I script it, the door keeps going into the wall completely and ending up on the other side instead of right next to the frame.
Yes it does, but I can’t open my mind to TweenService if I’ve already tried using it only for it to end up looking much worse than an if I used an animation. I’ve used Back for the easing style but it only makes it look worse compared to the animation option. I’ve never had this happen with any other Rig up until now.
Alright so my potential solution doesn’t need tweenservice and will still be smooth but you gotta work with me here, can I see the KeyframeSequence you have inside of the door
Try spending 2 days fixing something crucial to your game that you spent hours on modeling, rigging, positioning, and animating only to find no solution at all and the only available alternatives end up looking 10x worse than if you used an animation.
Alright, so create a new module script and put it inside of ReplicatedStorage and paste all of this inside of it
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local CutsceneAnimation = {}
CutsceneAnimation.__index = CutsceneAnimation
function CutsceneAnimation.new(sequence : KeyframeSequence)
local self = {}
setmetatable(self, CutsceneAnimation)
self.KeyframeSequence = sequence
self.Keyframes = sequence:GetKeyframes()
self.Frame = 1
self.Motors = {}
return self
end
function CutsceneAnimation:UpdatePose(frame, DT : number)
for _, pose : Pose in ipairs(frame:GetDescendants()) do
if pose:IsA("Pose") then
local Motor = self.Motors[pose.Name]
if Motor then
local x,y,z = pose.CFrame:ToEulerAnglesXYZ()
if x == 0 and y == 0 and z == 0 and pose.CFrame.Position.Magnitude == 0 then
continue
end
Motor.Transform:Lerp(pose.CFrame, DT)
end
end
end
end
function CutsceneAnimation:Play(Rig : Model, startCFrame : CFrame)
local CutsceneRig = Rig
self.CutsceneRig = CutsceneRig
local accumulatedTime = self.AccumulatedTime or 0
for _, motor in ipairs(self.CutsceneRig:GetDescendants()) do
if motor:IsA("Motor6D") then
self.Motors[motor.Name] = motor
end
end
if not startCFrame then
startCFrame = CutsceneRig.PrimaryPart.CFrame
end
CutsceneRig.PrimaryPart.Anchored = true
CutsceneRig.PrimaryPart.CFrame = startCFrame
CutsceneAnimation[Rig] = true
table.sort(self.Keyframes, function(a, b)
return a.Time < b.Time
end)
self:UpdatePose(self.Keyframes[self.Frame])
local Connection = nil
Connection = RunService.RenderStepped:Connect(function(DT)
if self.Paused then return end
accumulatedTime += DT
while self.Frame < #self.Keyframes and accumulatedTime >= self.Keyframes[self.Frame + 1].Time do
self.Frame += 1
self:UpdatePose(self.Keyframes[self.Frame], DT * 7)
end
if accumulatedTime >= self.Keyframes[self.EndKeyframe or #self.Keyframes].Time then
Connection:Disconnect()
Connection = nil
CutsceneAnimation[Rig] = false
end
end)
end
return CutsceneAnimation
After you’ve done that wherever you’re like opening the door do this, the pathToKeyframeSequence is the KeyframeSequence of the animation you want to play
local CutsceneAnimation = require(game.ReplicatedStorage.CutsceneAnimation)
local pathToKeyframeSequence = ''
local DoorOpen = CutseceneAnimation.new(pathtoKeyframeSequence)
DoorOpen:Play()
Just please give it a shot and tell me what happens @kalet14
local CutsceneAnimation = require(game.ReplicatedStorage.CutsceneAnimation)
local pathToKeyframeSequence = script.Parent.AnimSaves.Untitled
local DoorOpen = CutsceneAnimation.new(pathToKeyframeSequence)
script.Parent.Door.Handle.ProximityPrompt.Triggered:Connect(function()
DoorOpen:Play()
end)
It gives me this error for some reason. “ReplicatedStorage.CutsceneAnimation:36: attempt to index nil with ‘GetDescendants’”