I have been doing an animation which is to move (it is activated when the player presses the e key) it is supposed that when the player presses the e key an animation is activated and the position of the root part of the humanoid of the character of the character is changed. player, the position is changed, but the problem is that it moves to a specific place. Knowing that I programmed it to move a few more coordinates to the front. and i know it should work fine because i tried it with one part and it worked fine but i don’t really know what the problem is
here is the script:
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local char = player.Character
local animacion = script:WaitForChild("Animation")
local humanoid = char:WaitForChild("Humanoid")
local parteprincipal = char:FindFirstChild("HumanoidRootPart")
local tween = game:GetService("TweenService")
local info = TweenInfo.new(
0.29,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0)
local cambios = {Position = parteprincipal.CFrame * Vector3.new(0,0,-017.123)}
local value = true
local activar = humanoid:LoadAnimation(animacion)
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
if value then
value = false
local ejecutarTween = tween:Create(parteprincipal,info,cambios)
activar:Play()
ejecutarTween:Play()
wait(7)
value = true
end
end
end)
If I’m not wrong Vector3 is used for Models, not for parts, as you are using it for the HumanoidRootPart, not sure if it’s gonna work but try changing the Vector3 to CFrame
in the category it says COMMAND SEQUENCES. something you don’t understand…
Vector3 is for parts, PIVOT TO is for models. Also in the subject it says that I tried it with a part and it worked. but nice try @Dede_4242
Comments? There’s no comments in the scrip, also I forgot about the part we’re you said you tried with a part, but was taht part into a module or not, that could be the cause of the problem maybe…