Hi im trying to make a 2.5d game but i couldnt make my weapon point at cursor of mouse.
I want to make somerthing like this
Should this be done by raycast or its much more simple?
thnx 4 help!!!
Apr 16 '11 at 06:39 PM
var speedRot = 1.0f;
transform.LookAt( speedRot*Vector3(Input.mousePosition.x-Screen.width/2, Input.mousePosition.y-Screen.height/2, 0) );}
Apr 18 '11 at 11:26 PM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: Apr 16 '11 at 06:39 PM
Seen: 1428 times
Last Updated: Apr 16 '11 at 06:39 PM
Mouse Aim- Weapons
Side Scrolling Shooter. How to aim my bullet trajectory at the mouse cursor?
Can anyone translate this to C# (Change cursor appearance)
fire towards mouse pointer
Locking cursor without changing position
Aiming With my mouse
Hiding a Cursor?
Gun object following mouse.
first person - hide mouse
3d Cursor Representation