Posted December 16, 20222 yr I am struggling to figure out how to calculate the heading for a projectile, i.e. in .shoot or setArrowHeading, between two entities. For example, if I have entities A and B, and I want a projectile to fire from A to B but want to ignore the facing, I had thought it would have been simple enough to do ... x = target.getX() - firer.getX() ... for x, y and z. This seems to fire it in weird and wonderful directions. After much Googling, it is still not clear to me what I should be passing into shoot for pX, pY and pZ. Any tips or suggestions would be really appreciated. Edited December 28, 20222 yr by Scytale
December 16, 20222 yr if the idea requires mathematical knowledge that you do not have (working with angles) and programming skills you do not have (skipping math and finding a way to reuse existing projectile logic), why are you still working on this mod? surely you can come up with a mod idea without impassable barriers.
December 16, 20222 yr Author 20 minutes ago, MFMods said: if the idea requires mathematical knowledge that you do not have ... My experience to date, in this forum, has been some wonderful friendly people who were willing to help and provide some kind assistance.
December 28, 20222 yr Author Aside from the passive aggressive response, there was a tip buried there ... mathematical knowledge. For closure ... The heading between two entities is a rotation around the x and y axis - x for horizonal rotation and y for vertical. Thus simple trigonometry is used to calculate the angle of rotation between the x,y coordinates of the two entities.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.