CFrame without part?

So with the confusing title, it may be hard to understand what im saying, basically, I have a lot of things in my game that move the players HRP Cframe to a already exsisting part that is a copy of the HRP, named something like “RandomPosition” and I will usually put the players HRP Cframe to the CFrame of that, but is there a way to have the player face a certain way and move to a position easily without having parts like this scattered across my map?

Cframe require a object with Cframe property to move but Cframe goal don’t require an object to move

You can store all of the CFrames in an array, and pick a random one from the table:

local CFrames = {, 0, 0)

local r = CFrames[math.random(1, #CFrames)]
characterHRP.CFrame = r
1 Like

Agreed with what @Raretendoblox said. Also, CFrames can be rotated by multiplying them with the angle constructor.
CFrame.Angles(x, y, z)
The angular components are evaluated in the Z - Y - X order.

If you’re avoiding parts for editing or raycasting reasons you could also try using Attachment instances put inside Terrain or any part. You can still position them using the Studio tools instead of having to manually punch in numbers like using a script does.


Try using CFrameValue objects. Just know that you’ll need to set the Value property of each one using the command bar. Like this:

workspace.MyCFrameValue.Value = workspace.Part.CFrame

Basically, what im going to do now is just put a print script in the randomposition that prints the CFrame, and use that in the script.