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
1 Like
ztvxnz
(Raider)
December 21, 2023, 9:37am
#2
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)
ztvxnz
(Raider)
December 21, 2023, 9:56am
#4
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
ztvxnz
(Raider)
December 21, 2023, 9:58am
#6
**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
Yeah! exactly like that, but having a little offset so it isnt on top of the player, but a few studs away
ztvxnz
(Raider)
December 21, 2023, 10:07am
#13
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
system
(system)
Closed
January 4, 2024, 10:07am
#14
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.