Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
So, yeah, I'm here again, and I have a trouble with scripting. I'm trying to make a mobile game. And I wanted to make "2D" movement slightly different. Character has a gun, which should push the palyer away with recoil and, well, shoot. The thing is that the gun constantly rotates, so, recoil vector should be different pretty much. And, uh-h, I don't exactly know how to push player away according to rotation of weapon, due to the fact that, well, I am not that comparable with maths. For better explaination, here's the screenshot to demonstrate what I need: |
||||
|
Hello again. I've managed to make the script for it (ha-ha, evolution), but I can't make it move object smoothly. The thing is: 1) If I add "return false" in "if (this.LastTime == null)" and "return true" in the end of script, then it, for some reason, turns "if (this.LastTime == null)" into a cycle, while the rest of script isn't working. 2) If I won't add these, then script gives me this message in the log: "action_PunchBack:32:TypeError: pos is undefined". I know, I am bad at explaining the problems with my sh- I mean, code, so, I'll leave the prototype of project (to better understand how it works): https://disk.yandex.ru/d/EJgFHDR... |
|