Hello, I made parts randomly spawn into the sky and fall. I am trying to tween it to hit the ground but it instead goes to the center of the baseplate sadly.
local TweenS = game:GetService("TweenService")
local Meteor = script.Parent
local Goal = {}
Goal.Position = Vector3.new(script.Parent.Position.X , 0.5 , script.Parent.Position.Z)
local Tweeninfo = TweenInfo.new(0.7)
local Tween = TweenS:Create(Meteor , Tweeninfo , Goal)
Tween:Play()
You wrote the goal wrong, it should look something like this:
local TweenS = game:GetService("TweenService")
local Meteor = script.Parent
local Goal = {Position = Vector3.new(script.Parent.Position.X , 0.5 , script.Parent.Position.Z)}
local Tweeninfo = TweenInfo.new(0.7)
local Tween = TweenS:Create(Meteor , Tweeninfo , Goal)
Tween:Play()
1 Like
Your script looks good. There are no syntax errors, no table errors. There’s actually something wrong with when creating a Vector3 unit.
Vector3 requires the axes X, Y, Z coordination in order. That is what you have done. Tween was processing, but you couldn’t know how it had been moving. It was only falling through the Y-axis. So you must have seen it as immobile.
I advise you to use the Completed event to check if it was completed. If it printed out successfully, then do what I said below.
Tween.Completed:Wait()
print("Tween completed!")
Next, replace the X and Z-axis’ position in the Vector3 unit each other. Something like this:
local Goal = {}
Goal.Position = Vector3.new(script.Parent.Position.Z, 0.5, script.Parent.Position.X)
Summary
The issue is not within tables. You just did put the axes in the same position.
Make sure the axes X and Z coordination aren’t equivalent, so you’ll experience the same.
1 Like
Non of these answers worked. DevForum fails to let me send a photo or video. Theres no error, it just puts the falling part to the center of the map where I wanted it to fall straight down.
Try to anchor the part maybe it will work lol