Instatiate an object with force not working?

I’m trying to use the standard “instantiate an object and project it forwards” script (in the exact direction the camera is facing) but it’s kicking it out 90 degrees to the left instead? Anyone else seen this?

I have my camera with mouselook.js attached to a FPS object and want the game object to spawn just under the camera and shoot in exactly the direction the camera/player is looking. No raycast to object involved as it needs to just shoot regardless if there’s anything to hit.

90 degrees left … weird.

Sounds like the object’s forward axis is 90 degrees off compared to the camera’s forward axis. Or is that script attached to the camera? Either make sure the axes of the objects are all oriented the same, or you could just change the script to use a different axis. But I’d say making sure the objects are physically correct is better because you never know what else might go wrong.

–Eric

It’s attached to the camera. But I sort of figured it out. It’s shooting a ball where the cursor is on the screen, not where the camera is looking.

Fixed it by locking and hiding cursor. Also found the set screen resolution line of script … nice. :slight_smile: