Hello there! I’m having issues making a script for my future game:
In the first script, I want a part to remain above my character head, which works as expected:
local Part = workspace:WaitForChild("Part")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head : BasePart = Character:WaitForChild("Head")
while task.wait() do
Part.Orientation = Head.Orientation
Part.Position = Head.Position + Vector3.new(0, 4, 0)
end
However, when I try to use a Model’s PrimaryPart instead, it simply doesn’t move. I’m getting this error and I’m pretty lost since Orientation IS a property of PrimaryPart.
local Model = workspace:WaitForChild("FBXImportGeneric")
local PrimaryPart : BasePart = Model.PrimaryPart
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head : BasePart = Character:WaitForChild("Head")
while task.wait() do
PrimaryPart.Orientation = Head.Orientation
PrimaryPart.Position = Head.Position
end
Any help is appreciated! <3