x


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!!!

more ▼

asked Apr 16 '11 at 06:39 PM

GDKJustJonny gravatar image

GDKJustJonny
11 1 1 3

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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) );}
more ▼

answered Apr 18 '11 at 11:26 PM

GDKJustJonny gravatar image

GDKJustJonny
11 1 1 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1001
x461
x202
x104

asked: Apr 16 '11 at 06:39 PM

Seen: 1428 times

Last Updated: Apr 16 '11 at 06:39 PM