Part spawns rotated weirdly

Hello. So I’m working on a portal ability that spawns 2 portals, one in front of the player and the second one at Mouse.Hit CFrame but I ran into an issue with the second portal. Just like the first portal always comes out straight, the second one always ends up being slanted and rotated towards the ground. I’ve been trying to mess around with orientation and lots of different stuff but I literally cannot come up with a solution so I was hoping someone here could help me. I’m attaching gyazo links to show a visual of the problem.

https://gyazo.com/ef535c5b745cb892875f44a019bc8e3d
https://gyazo.com/97f7274f632161be166bcc702ca7026a
https://gyazo.com/c3f08a34d2cd13997719654d63aa9cd3
https://gyazo.com/ec2d504416b54cfef4b28616968f58be
https://gyazo.com/1421481f288457bd6a9e390fc13def23

I believe this is because “Mouse.Hit” is a CFrame itself and not just a position, so it contains the rotation data of whatever face it touched, which would cause the problem of the part facing ground as you said. To fix this, I’d change it to something like:

…CFrame = CFrame.new(Mouse.Hit.Position + change in position)

1 Like

Yesss! This seems to have fixed the problem. Thank you so much! <3

1 Like