last post about this never got accepted
i want the part to move above the player thats it
you can weld the part to the player with offset
Put this a script inside starterCharacterScript.
local part = YourPart:Clone()
local weld = part.Weld -- INSERT WELD INTO PART in the studio
part.Parent = script.Parent
weld.Part1 = script.Parent.HumanoidRootPart
weld.Part0 = part
i dont want the part to be straight up attached to the player, i want it follow the player.
Closest thing i can think of is like pet simulator, where the pets follow you and arent attached or welded to you (i think, i dont play pet sim)
ohh, then maybe you can do a lerp. Or you can do tweens but idk how tweens in this situation. You can lerp the part position to the player root with an offset to be low on ground.
in my other post i made (that was not accepted) i had mentioned idk how to use larp or tweens. ive never used those
uhh mwean either but I found out I think its like
part.Position:lerp(GoalPosition,.1)
do this every renderstepped (you may have to account for higher/lower fps using delta)
the second argument , .1 , is the higher you put it faster it is.
how do i make it stay above the player?
you can do an offset so you make the goalposition the humanoidrootpart and then add so like:
part.Position:lerp(HumanoidRootPart+Vector3.new(0,5,0),.1)
If you are talking about attaching the part to the player that it follows you with a bit of sining.
All you have to do is make a loop. You can include a RunService
and then you need to use the Heartbeat or something. Just anyway to create a loop and you’re good to go.
Then you need a value for the offset of the part so it gives of a bit of distance from the player.
local runService = game:GetService("RunService")
local offset = CFrame.new(0,0,0) -- set this to anything you want
local rate = 0.5 -- same with this one
local lastCFrame = CFrame.new()
local object -- path to selected object you want to follow de player
local humanoidRootPart = character.HumanoidRootPart -- im pretty sure u know what that is
runService.Heartbeat:Connect(function()
object.CFrame:Lerp(humanoidRootPart.CFrame * offset, rate)
end)
I haven’t tested this so…
blud you literally copy me
it says i cant add a vector3 value…
try this actualy
part.Position:lerp(HumanoidRootPart.Position+Vector3.new(0,5,0),.1)
replace humanoidrootpart with your
thats the same thing u did before
My version involves CFrames. Your version involves Positions which excludes the orientation. If OP considered making the part follow the player without changing orientation, then he may use your answer.
ok maybe
local RootPart = HumanoidRootPart
part.Position:lerp(Vector3.new(RootPart.X,RootPart.Y+5,RootPart.Z),.1)
Oh ok . I understand aaaowAAAAAAAAAAAAAA
Wait no!, actually, try this.
Part.CFrame:Lerp(CFrame.New(HumanoidRootPart.Position)*CFrame.new(0,5,0),.1)
you copied me!!!
Proof1?!?!?!?!??!?!?!?!?!?!?!!?!?!?!?!?!?!?!?!?!?!?!?!?! Hm Proof?!?!?!