I’m currently having trouble making this model move with BodyPosition. The model has cancollide off so it is able to just move through walls, so when play testing the model just falls though the floor and with cancollide on it just falls to the floor. The model’s parts are all welded individually to the HumanoidRootPart, with the welds being like this Part0 is always the part the weld is under.
My BodyPosition is located under the HumanoidRootPart and properties look like this The position changes when the model spawns, and when the model reaches the position.
And if you need it to help me with my problem, here’s a picture of the model in the explorer:
Try just increasing the MaxForce to be somewhere around 100000 for each axis, and then making the power 100000.
I just tried this, it didn’t seem to change anything.
Why do you need to move the model? Because it might be easier for you to just use tweening rather than a body position,
I guess I could try tweening it instead… It’s supposed to look as if it were swimming around.
I see, so it’s like a large crystal in water?
It’s a sea turtle with crystals on its shell.
Oh, that’s cool. So what I think you need is for it to be just swimming around in some water? Let me see if I can try to make a tween for that
Update on the tweening, I made a tweening script and it works, however since it’s a tween for some reason the rest of the turtle (I made only the humanoidrootpart) doesn’t move with the tweening part even though every part is welded to it. Is there a way to tween the entire model? I don’t use TweenService very much.
Well I just managed to make it work by instead changing the CFrame of the humanoidrootpart instead of it’s position, however now I’m not able to rotate the model to look at where it’s supposed to be swimming to. I’m pretty sure since now the CFrame of the part is being changed my line of code changing the lookvector is now overridden.
Sorry I was gone for a while, I had to go do something. Do you mind posting the script you’re using?
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
10, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local SeaTurtle = script.Parent
local Part = game.ReplicatedStorage.Regions.SanctuaryBorder.WholeArea
local Pos = Part.CFrame * CFrame.new(math.random(-Part.Size.X/2, Part.Size.X/2),math.random(-Part.Size.Y/2, Part.Size.Y/2),math.random(-Part.Size.X/2, Part.Size.X/2))
local Swim = TweenService:Create(SeaTurtle, tweenInfo, {CFrame = Pos})
Swim = TweenService:Create(SeaTurtle, tweenInfo, {CFrame = Pos})
Pos = Part.CFrame * CFrame.new(math.random(-Part.Size.X/2, Part.Size.X/2),math.random(-Part.Size.Y/2, Part.Size.Y/2),math.random(-Part.Size.X/2, Part.Size.X/2))
Swim:Play()
script.Parent.CFrame = CFrame.new(script.Parent.Position, Pos.Position) -- this is where im trying to set the lookvector also
Swim.Completed:Connect(function()
Swim = TweenService:Create(SeaTurtle, tweenInfo, {CFrame = Pos})
Pos = Part.CFrame * CFrame.new(math.random(-Part.Size.X/2, Part.Size.X/2),math.random(-Part.Size.Y/2, Part.Size.Y/2),math.random(-Part.Size.X/2, Part.Size.X/2))
Swim:Play()
script.Parent.CFrame = CFrame.new(script.Parent.Position, Pos.Position) -- this is where im trying to set the lookvector
end)
-- i dont know why this is all double spaced
I think that you can’t set the lookvector because it’s a model. Have you tried using :SetPrimaryPartCFrame() or does that not work either?
I have not tried that, let me see if it will work.
It didn’t seem to make a difference at all.
Odd. However, after thinking about it for a minute, wouldn’t it be easier if you used the pathfinding service? What you could do is simply make a random position in the selected area using the same “Pos” variable and then simply relocate the point each time the location is reached. Or, if you want more fluid/less random motion (since it could go right next to itself again when repositioned) you could have a preset folder for points inside the area it can swim in and then loop through the table each time the position is reached.
Sorry to keep suggesting different things
Do you think I could incorporate the script.Parent.Parent:SetPrimaryPartCFrame(CFrame.new(script.Parent.Position, Pos.Position))
With the Tween?
TweenService:Create(SeaTurtle, tweenInfo, {CFrame = Pos -- here is where i mean})
That’s the only other way I could think of this working, unless I make another HumanoidRootPart type part that I could rotate instead.
try changing the P higher maybe higher than the D
I’m not sure, I don’t use models that much - but it’s worth a shot to try
Well, I changed the Tween to TweenService:Create(SeaTurtle, tweenInfo, {CFrame = CFrame.new(Pos.Position, Pos.Position)})
But all that seemed to do was send the turtle to
0, -340282346638528859811704183484516925440, 0