![]() |
this.angle
im trying to get a weapon to activate when you click the mouse and fire itself on a path towards your mouse co-ordinates on click. ive seen some mention of this.angle, and i think this is what i need.
tell me,1) how do i use this.angle for angling weapons? 1a)what calculations to i need to make? 1b)how do i move the weapon on the angle? 2)is the angle value of a 360 degree circle? |
I am not sure what you mean, correct me if I am wrong.
1) 'this.angle' is not something predefined. You have to give a value to this.angle. I am assuming that you are probably thinking of using 'this.angle' with a shoot command. 1a) There is a 'getangle' command which you can use to 'get' the angle you want: HTML Code:
getangle(delta x,delta y)HTML Code:
this.angle = getangle(mousex-playerx, mousey-playery);2) The graal scripting engines generally uses radians rather than degrees. |
ah, so its not predefined! thanks. (1b assumed it was predefined) i had seen parts of scripts where this.angle was used, and assumed it was predefined.
this.angle = getangle(mousex-playerx, mousey-playery); i had tried doing a simliar operation with the 2 seperate variables.. sounds like it was just bad programming not misunderstasnding of the language :\. thanks for your help. |
| All times are GMT +2. The time now is 11:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.