Move an object while in a paused annimation

im currently tying to make an ability creating a sphere in front of the hand of the player, for that i use an annimation that i pause in a local script, then i fire a remote event and clone the ball, trying to move it to the arms position then move it in front of the arm makes it very random even just moving to to the arms position is kinda random i don’t really know what do to more

        RedEvent.OnServerEvent:Connect(function(player)
	local LeftArm = player.Character["Left Arm"]
	local RedBall = DebugFolder.RedReversalPoint:Clone()
	RedBall.Parent = workspace
	--RedBall.Position = LeftArm.Position
	RedBall.CFrame = LeftArm.CFrame * CFrame.new(Vector3.new(0,-2,0))

end)

local script to start and pause the animation

	if input.KeyCode == Enum.KeyCode.G then
		
		DisableMovement()
		ReversalRedAnimTrack:Play()
		task.wait(0.5)
		RedAnimTrack:AdjustSpeed(0)
		RedEvent:FireServer()
		
	end
7 Likes

Instead positing the sphere on the hand just make the sphere welded to the hand and make it massless so it doesn’t cuase any triple with the moving character.

    local LeftArm = player.Character["Left Arm"]
	local RedBall = DebugFolder.RedReversalPoint:Clone()
    RedBall.Parent = LeftArm
    RedBall.Massless = true
	local weld = instance.new("Weld")
	weld.Parent = LeftArm
    weld.Part0 = LeftArm
    weld.Part1 = RedBall 
	weld.C1 = CFrame.new(Vector3.new(0,-2,0))
5 Likes

doing that actually teleport me to the original redball

note that the redball is composed of a red small ball and another part as child to make some particle effect, both i use a weld contraint to keep them together, both of theme are unanchored and massless

image

4 Likes

Make sure you set Part1 of the weld that we created to the Part0 of the weld inside RedBall.

weld.Part1 = RedBall.WeldConstraint.Part0
5 Likes

same thing happens, i get teleported to the original redball, note that the player can’t move or rotate camera during the annimation

https://gyazo.com/35e01efc690a9af54f85d5a5eadaec00

5 Likes

can you show me before the code i sent you?

5 Likes

local script code :

image

script code :

image

(the code in comment is the things i tried doing before)

4 Likes

Sorry, vidoe of it please, i just want to see what happening it might be fixable.

4 Likes

this happens, teleports me to the original ball

https://gyazo.com/35e01efc690a9af54f85d5a5eadaec00

3 Likes

Sorry for the confusion i meant before i gave you the code of lines.

3 Likes

oh then with this code :
image

this happens, red ball spawn neer the arms but never in the same place, didn’t put a cooldown on it but will later on

https://gyazo.com/427f8e2a69d0261db8cfa380d3f54295

3 Likes

I see what is happening here,
Somehow you have a Part inside it two parts and you just move the Part to the position but snice you have weld you will not move the childern that is welded so what you need is just weld the ParticlePart to RedReversalPoint so if you moved RedReversalPoint the children will move with it and make sure you weld it to the Part0.

2 Likes

i had a weld constaint (child of RedReversalPoint) with part 0 being RedReversalPoint and part 1 being ParticlePart

image

3 Likes

Update : instead of welding the particle part i just move both and it works fine however the position is still random somewhat random

ReversalRedEvent.OnServerEvent:Connect(function(player)
	local LeftArm = player.Character["Left Arm"]
	local ReddballParticle = DebugFolder.RedReversalPoint.ParticlePart
	local RedBall = DebugFolder.RedReversalPoint:Clone()
	RedBall.Parent = workspace
	RedBall.Position = LeftArm.Position
	RedBall.CFrame = LeftArm.CFrame * CFrame.new(Vector3.new(0,-2,0))
	
	ReddballParticle.Parent = workspace
	ReddballParticle.Position = LeftArm.Position
	ReddballParticle.CFrame = LeftArm.CFrame * CFrame.new(Vector3.new(0,-2,0))
end)

image

image

2 Likes

update i just set the red’s position relative to the humanoid root part since it doesn’ move here is the code

ReversalRedEvent.OnServerEvent:Connect(function(player)
	local LeftArm = player.Character["Left Arm"]
	local hrp = player.Character:WaitForChild("HumanoidRootPart")
	local ReddballParticle = DebugFolder.RedReversalPoint.ParticlePart
	local RedBall = DebugFolder.RedReversalPoint:Clone()
	RedBall.Parent = workspace
	RedBall.Position = hrp.Position
	RedBall.CFrame = hrp.CFrame * CFrame.new(Vector3.new(-1.722,0.5,-2.5))
	
	ReddballParticle.Parent = workspace
	ReddballParticle.Position = hrp.Position
	ReddballParticle.CFrame = hrp.CFrame * CFrame.new(Vector3.new(-1.722,0.5,-2.5))
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.