How do I teleport a model infront of the player?

So i have a model that i’m moving to the player using PivotTo()
Then im placing it on the ground by firing a raycast and getting it’s hit position

But I’m missing the part matching the players rotation and also having an offset so its infront of the player

Example:

I am in need of assistance :sob:
1 Like

Can i see the script so i can find out whats the problem!

Sure!

Here:

Rep_Event.OnServerEvent:Connect(function(plr:Player, action:boolean, object:Instance, position:Vector3, extraRot:Vector3, ReferencePart:BasePart)
	
	if action == true then
		local model = object:Clone()
		model.Parent = plr.Character
		model:PivotTo(CFrame.new(ReferencePart.CFrame.X, position.Y, ReferencePart.CFrame.Z))
		
	elseif action == false then
		
		plr.Character:FindFirstChild(object.Name):Destroy()
		
	
	end
	
end)

it might be because ur using Raycast hit position as the location inside of using the Players Root CFrame as the CFrame

Yea i know its because of that but… I’m wondering how do I do it correctly.

Like how do I place it infront of the player, AND touching the ground with the Raycast’s position

**Can u explain more on that!!

Hey please don’t tell at me I’m a very sensitive person

What I’m trying to achieve is:

  • Teleporting the model infront of the player
  • Making the model be in contact with the ground

Like this?

“I made a quick example”

Yeah! exactly like that, but having a little offset so it isnt on top of the player, but a few studs away

If u want The Angle to be a little higher just mess with CFrame Angles,And for Moving it a little Far or Shorter just mess with the CFrame

“And make sure u have a primaryPart for the model”

If any problem just let me know!

	local Explain = rs.Model:Clone()
	Explain.Parent = workspace
	Explain:PivotTo(root.CFrame * CFrame.new(0,0,.4) * CFrame.Angles(math.rad(-50),0,0))
end

1 Like

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