So I have a model. A tank, with several parts that are welded to one base part.
I want to tween the Motor6D’s C0 position so I can basically use that to move the model from point a → b
But when I put the C0 position as the position of a part (Point B) it doesn’t even go close. What am I doing wrong here? How does one use a M6D’s position property properly?
So, all parts of your tank are welded by Motor6d’s? and you want to change the motor6d position of C0 of a part in tank to “Point B position”. But what is Point B part? An external part that doesn belong to tank? and that Point B position is a World Coordinate position of that part?
That will never work, cause motor6d needs a relative position, relative to where is welded, it wont accept a world coordinate.
Example, if you change pos of C0 of a motor6d, to 5 studs, that would be 5 studs away from its original position.
If you have a part in workspace with a coordinate position of 500, and you use that 500 to update the motor6d, that would be 500 studs away from the origin point of the motor6d.
I want to create a tank that can rotate it’s cannon on top. And also be able to move (the entire model and rotate) and be able to tween from position to position. How would I go about this?
Thank you, I read through just about all of your post. Maybe I missed it, but I didn’t see anything pertaining to how to move a part that contains welds or M6D.
How would I go about moving a part (base) like for example a car has a base and 4 wheels. If I move the base, I need to move the wheels with it. This part I can’t seem to figure out. If it’s in your tutorial though can you point out which part, I must of missed it if so. It’s hard to read that much text and keep focus on every aspect when it’s brand new information to me.
I previously had that, and when I tried to change the Position of the part it instantly detatched all the welds and flung off.
wait(3)
local tweenService = game:GetService("TweenService")
local part1 = script.Parent
local part2 = game.Workspace.FacePart -- the destination part
local goal = Vector3.new(part2.Position)
local info = TweenInfo.new(1, Enum.EasingStyle.Linear) -- Tween for 1 second with linear easing
local tween = tweenService:Create(part1.Base, info, {Position = goal})
tween:Play()
Thats because you are tweening the Position and not the CFrame.
If you tween the CFrame property all welded parts by a WeldConstraint will move along with the model, if you tween the position those parts will not move
Should be like this: local goal = part2.CFrame local tween = tweenService:Create(part1.Base, info, {CFrame = goal})