Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get the position of a mouseclick?

I have a tool that, when clicked, spawns a horse where the person clicked. For some reason, The horse does spawn, But not at the place where someone clicks. It spawns at one location only... Could I have same help with this?

Also, Sorry for not posting any Lua code, The code is on another computer ;-;

Any help is appreciated, Thanks!

1 comment

0

You could use mouse.Hit.p, but then if the player clicks in the air the horse will spawn in the air, so I hope someone has a better solution.

1 answer

✓ Accepted answer

You would use Mouse.Hit to get the position of the mouse, in the game. For example:

game.Workspace.Part.Position = game.Players.LocalPlayer:GetMouse().Hit.p -- Remove the p if it doesn't work

1 comment

0

Thanks :D

This discussion is preserved as it was. New answers, comments, and votes are closed.