2.5d game gun aim

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

http://www.funny-games.biz/plazma-burst-2.html

Should this be done by raycast or its much more simple?

thnx 4 help!!!

1 Answer

1

I found solution by my self...

var speedRot = 1.0f;

    function Update(){        
        transform.LookAt( speedRot*Vector3(Input.mousePosition.x-Screen.width/2, Input.mousePosition.y-Screen.height/2, 0) );}