I have a problem thats brought my rpg game development to a hault.
I have a character that has a sword attack animation and in those frames of the attack is an "image point" thats postioned at the end of the sword in each frame.
When the user attacks and the attack animation starts to play i have a small sprite box that i use as a collision box for the sword to hit enemies.
The collision box is created when the sword attack animation starts(once only) at the "Image point" at the end of the sword.
As the attack moves throught the various frames the Collision box is supposed to set itself to the "Image point", however the collsion box positions does not tally with the "image points" of each frame. So its causing my sword collisons to be way off.
There is nothing i can see that could cause this.
I'm working on another way to add collisions to my sword attack in the event i cant solve this.I would like to know if anyone could help on this matter and would be much appreciated.
Develop games in your browser. Powerful, performant & highly capable.
if collision box is on screen -set position to player.imagepointx(1), player.imagepointy(1)
do the trick?
Every tick -> set Collision Box.X to sword.ImagePointX(ImagePoint)should work.
So setting the collision box position when "sword attack animation is playing" causes the problem?, mmm not sure why. I'll try those 2 options and see if that solves it, thanks guys much appreciated :).
Still has the same problem, however i've done a work around using a centered sprite and pivot to mimic the sword. still none of the wiser why its does't work my original way. Thanks anyway guys :)
I assume that when you created the CD you immediately pinned it to the sword?
The original method i tried i didn't as it was as the animation was playing it was set to the image points so there'd be no need to pin it