Hello,
I used Ballistics and its targeting not working as expected…
How i can make it work according to following image?
Here is the project link…
https://playcanvas.com/project/797244/overview/ballistics-test-2d-char-fork
It would be great if anyone can help…
Hi @Ketan_ATA,
I think if you are looking for more realism on the arrow movement, one thing to improve is to gradually point the arrow towards the direction of the movement.
Calling @LeXXik, he is the author of the library, we definitely knows more.
Right, so the Ballistics library doesn’t offer a method, that would allow to solve the impulse based on the starting angle and the target. Perhaps, I should add one, seems like a useful one.
What you can do currently is to use the solveLateralStatic
method (API). One of the inputs is the height
. It is the extreme point of the trajectory. You can add some pivot point entity to the scene, that you can read the height from:
You would then make your bow to look at that pivot point, which you can then move up and down (making the bow also follow it). Once ready to fire, the Ballistics will calculate the impulse for you that you then apply to the arrow entity rigidbody.
2 Likes