So I made a similar post earlier today but since my code has more conditions that I didn’t mention in this post, I couldn’t really figure out how to solve this (sorry for the unnecessary post earlier today).
I’m currently working on a tent placement system. I wanted the tent to spawn in front of the HumanoidRootPart of the player who’s spawning the tent.
game.ReplicatedStorage.Remotes.PlaceTentEvent.OnServerEvent:Connect(function(player)
local clone = game.ServerStorage.CampingStorage.StarterTent:Clone()
clone.Parent = game.Workspace
clone.Name = player.Name.."sTent"
clone.PrimaryPart.CFrame = player.Character.HumanoidRootPart.CFrame + player.Character.HumanoidRootPart.CFrame.lookVector*15
clone.Owner.Value = player
end)
This is my code and it works fine. However, I want it to spawn on top of a part (on the floor) and not in the air. To make it easier, I named every part that’s supposed to be floor “Baseplate”. I have multiple floor layers so they all have different y axes. How do I do that? Thank you for reading!