Model Facing Wrong Way

I want the glowing part to face the same side as players face but i don’t know how to change it and i couldn’t find anything that solved this


.

4 Likes

Rotate the placeholder block 90° to the right, since the front face is rotated 90 to the left

2 Likes

It doesn’t help… Maybe it’s beacuse i use Instance.new for the placeholder part

2 Likes
-- replace with your part's name
part.Orientation = Vector3.new(0, -90, 0)

or use what @pumpkyrofl said

2 Likes

use math.rad(90) to twist the model lol (on cframe.angles)

2 Likes

oh also please provide the code

2 Likes

It still doesn’t work :frowning:

local Drone = game.Workspace.Drone.PrimaryPart
local DroneModel = game.Workspace.Drone

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		

		local DronePositionPart = Instance.new("Part",workspace)
		DronePositionPart.Rotation = Vector3.new(0,270,0)
		DronePositionPart.Size = Vector3.new(3,3,3)
		DronePositionPart.CanCollide = false
		DronePositionPart.Transparency = 0.6
		DronePositionPart.Anchored = true
		
		local HRP = char:FindFirstChild("HumanoidRootPart")
		
		Drone.Orientation = Vector3.new(0,-90,0)
		
		local AlignPosition = Instance.new("AlignPosition",Drone)
		
		local AlignOrientation = Instance.new("AlignOrientation",Drone)
		
		local Attachment0 =Instance.new("Attachment",Drone)
		
		local Attachment1 = Instance.new("Attachment",DronePositionPart)
		
		AlignPosition.Attachment0 = Attachment0
	
		AlignPosition.Attachment1 = Attachment1
		
		AlignOrientation.Attachment0 = Attachment0
		
		AlignOrientation.Attachment1 = Attachment1
		
		while task.wait() do
			DronePositionPart.CFrame = HRP.CFrame * CFrame.new(0,6,0)
		end
		
	end)
end)
local Drone = game.Workspace.Drone.PrimaryPart
local DroneModel = game.Workspace.Drone

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		

		local DronePositionPart = Instance.new("Part",workspace)
		--DronePositionPart.Rotation = Vector3.new(0,270,0)
		DronePositionPart.Size = Vector3.new(3,3,3)
		DronePositionPart.CanCollide = false
		DronePositionPart.Transparency = 0.6
		DronePositionPart.Anchored = true
		
		local HRP = char:FindFirstChild("HumanoidRootPart")
		
		--Drone.Orientation = Vector3.new(0,-90,0)
		
		local AlignPosition = Instance.new("AlignPosition",Drone)
		
		local AlignOrientation = Instance.new("AlignOrientation",Drone)
		
		local Attachment0 =Instance.new("Attachment",Drone)
		
		local Attachment1 = Instance.new("Attachment",DronePositionPart)
		
		AlignPosition.Attachment0 = Attachment0
	
		AlignPosition.Attachment1 = Attachment1
		
		AlignOrientation.Attachment0 = Attachment0
		
		AlignOrientation.Attachment1 = Attachment1
		
		while task.wait() do
			DronePositionPart.CFrame = (HRP.CFrame*CFrame.new(0,6,0))*CFrame.Angles(math.rad(90),0,0)
		end
		
	end)
end)
3 Likes

Thank you! It works perfectly now

1 Like

You solved that as I was putting this together and testing it.

Server
--server script
local part = workspace:WaitForChild("Part")
local Players = game:GetService("Players")

local function update(player)
	local playerCharacter = player.Character
	if playerCharacter then
		local head = playerCharacter:FindFirstChild("Head")
		if head then
			local lookVector = head.CFrame.LookVector
			part.CFrame = CFrame.new(part.Position, part.Position + Vector3.new(lookVector.X, 0, lookVector.Z))
		end
	end
end

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		
		
		task.wait(5)
		update(player)
	end)
end)
Client
--client script 
local part = workspace:WaitForChild("Part")
local player = game.Players.LocalPlayer

local function update()
	local playerCharacter = player.Character
	if playerCharacter then
		local head = playerCharacter:FindFirstChild("Head")
		if head then
			local lookVector = head.CFrame.LookVector
			part.CFrame = CFrame.new(part.Position, part.Position + Vector3.new(lookVector.X, 0, lookVector.Z))
		end
	end
end


task.wait(5)
update()


LookVector is great for this …

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.