|
|
Re: Tilting Bullets with Mouse Movement
[Re: bk9iq]
#351093
12/21/10 19:47
12/21/10 19:47
|
Joined: Jul 2010
Posts: 129
bk9iq
OP
Member
|
OP
Member
Joined: Jul 2010
Posts: 129
|
Sorry I could solve the problem even though I guess It is not the best solution:: here's what I did::: var bullet_tilt; function move_bullet() { VECTOR bullet_speed; bullet_speed.x= 10*time_step; bullet_speed.y= 0; bullet_speed.z= 0; my.pan=player.pan; vec_rotate(bullet_speed.x,vector(0,bullet_tilt,0)); while(me) { bullet_tilt += mouse_force.y * 8 * time_step; bullet_tilt = clamp(bullet_tilt,-15,45); c_move(me,bullet_speed.x, nullvector,0); wait(1); } } is there any better way?? Thanks
Last edited by bk9iq; 12/21/10 19:48.
|
|
|
Re: Tilting Bullets with Mouse Movement
[Re: bk9iq]
#351096
12/21/10 20:14
12/21/10 20:14
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
As you can see in your bullet script, each bullet's PAN equals to player PAN (my.pan = player.pan). But you didn't define TILT... You can place model at the center of player, and then make a pointer (for example) bullet_pos. Then you change bullet_pos.TILT with mouse_force.y and make it's PAN equal to player's PAN. And after all that, in your bullet script, make bullet's PAN,TILT,ROLL equal to 'bullet_pos' PAN,TILT and ROLL (vec_set(my.pan,bullet_pos.pan);) I hope point taken.
Edit: I've noticed that there are a lot of errors in your script, that's why it doesn't work...
Last edited by 3run; 12/21/10 20:43. Reason: *****
|
|
|
|