Making a spawning script

Hello,
I’ve been thinking to implement some kind of summoning magic but I have no idea where to start, I was thinking the players presses’s a hot key then clicks and a ledge appears where ever his mouse is pointing at, I’m not too sure of how ill position the ledge correctly where the player’s pointed at so I’m seeking some guidance

Pictures to explain further more:

Before:

After:

You can try using UserInputService:GetMouseLocation and use that for raycasting

My problem is positing the ledge

Cast a ray from the camera or characters head and use the Position and Normal parameters to find where and which way to face.

How does that link with the mouse position?

If you cast a ray along the heads’ LookVector, it’ll cast a ray to the cursor(I think).

On the local scripts you can get the Mouse like: plr:GetMouse()
GetMouse can be used to get targeted objects or the mouse in the 3D space.

just use local Mouse = player:GetMouse and then find the position of the mouse with Mouse.Hit.Position