-
What do you want to achieve?
I want to learn a way to rotate a model the way player faces (without using primaryparts) -
What is the issue?
i don’t know how to rotate model the way player faces. -
What solutions have you tried so far?
I tried looking in devforum and i could only find something with look vector but i don’t know how to rotate model using look vector, i only know how would i make it move the way player faces but not rotate.
for i, Slot in pairs(script.Parent:GetChildren()) do
if Slot:IsA("TextButton") then
Slot.MouseButton1Click:Connect(function()
local AlingedToObject = Slot:FindFirstChild("AlingedToObject")
local Object = game.ReplicatedStorage.AssetsRS.Constructions:FindFirstChild(AlingedToObject.Value)
local ObjectClone = Object:Clone()
ObjectClone.Parent = workspace.PreviewStructures
for i, Part in pairs(ObjectClone:GetDescendants()) do
if Part:IsA("BasePart") or Part:IsA("MeshPart") then
Part.CanCollide = false
Part.CollisionGroup = "none"
if Part.Transparency <= 0.99 then
Part.Transparency = 0.75
end
end
end
while wait(0.25) do
ObjectClone:PivotTo(CFrame.new(script.Parent.Parent.Parent.Parent.Parent.HumanoidRootPart.Position + script.Parent.Parent.Parent.Parent.Parent.HumanoidRootPart.CFrame.LookVector * 5))
end
end)
end
end