Hello fellow developers! Recently I started scripting a gun, the gun worked fine. It shot when you clicked, went to the direction you clicked and what not but there was an issue. I wanna make it point to where you click so it looks realistic because when it fires its going in the direction but its facing forward and I wanna make it point to where your mouse is. Any solutions?
Could you provide the script which needs fixing?
Its.not really fixing but more like adding a line or two to make it point to where you click and sadly I cant provide the script since im using my iPad because for some reason the DevForum wont load on my pc
Could you describe what you mean by point to where you click? Do you want the gun to point to where you clicked?
Please search for answers before posting topics.
I searched for “arm point gun” and found several related topics including this.
Im trying to make the bullet face the direction where a player clicked so it doesnt just face forward
If your bullet is not facing the correct direction, you need to set the CFrame of the bullet part when you instantiate the bullet.
bullet.CFrame( bulletStartPosition, mousePosition )
bullet.CFrame = mouse.Hit