Dervex
(Dervex)
February 28, 2023, 9:47pm
#1
Let’s get straight to the point. Here is my code:
local motor = Instance.new('Motor6D')
motor.Name = self.viewmodel.ArmRoot.Name
motor.Part0 = self.viewmodel.ArmRoot
motor.Part1 = self.viewmodel.Weapon.Grip
motor.C0 = self.offset
motor.Parent = self.viewmodel.Weapon.Grip
which should work totally fine.
However look what happens after motor gets parented:
As you can see it shows at
0,0,0
position (relative to its parent obviously) and after one frame it changes its position to the correct one.
(Motor 6D is used to connect weapon model to the viewmodel.)
Any help is really appreciated as this is annoying as hell.
4SHN
(sniffrainsniffcatyes)
March 3, 2023, 6:04am
#2
maybe try cframing the model to the correct position before making it visible
the process might look cleaners like:
model’s parent is nil/replicatedFirst
cframe model and all of its parts to their respective places relative to character
setup the motor6D
parent the model to wherever in workspace you leave them
Dervex
(Dervex)
March 4, 2023, 12:01pm
#3
Unfortunately no luck. Code I used:
local clone = self.currentWeapon.Weapon:Clone()
local motor = Instance.new('Motor6D')
clone.PrimaryPart.CFrame = self.viewmodel.ArmRoot.CFrame
motor.Name = self.viewmodel.ArmRoot.Name
motor.Part0 = self.viewmodel.ArmRoot
motor.Part1 = clone.Grip
motor.C0 = self.offset
motor.Parent = clone.Grip
clone.Parent = self.viewmodel
Dervex
(Dervex)
March 10, 2023, 10:34pm
#4
Oh gosh I finally figured it out. Everything was caused by single task.wait()
inside module responsible for animations that I forgot to remove after debugging.
system
(system)
Closed
March 24, 2023, 10:34pm
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.