I think it’s not…
in heroe.js : import meleeWeapons from '../objects/meleeWeapons'
Edit : I try, nothing have changed …
I think it’s not…
in heroe.js : import meleeWeapons from '../objects/meleeWeapons'
Edit : I try, nothing have changed …
Hi @Nik0w,
After some tests, i have found a solution:
In your class Heroe add this preUpdate method:
preUpdate(){
this.weapon.updatePosition(this);
}
So, now in your class melleWeapon you don’t need the listeners for “pointermove” and “update” events.
Seems it was a timing problem with inputs or physics, I’m not sure.
Regards.
OH GOD !
It’s workinnnnnng !!!
Thank you so much !!!
How do you find this solution ??
This is my logic:
The updatePosition() worked when called from the ‘pointermove’ listener (run in preupdate), whereas when called from the update() of the Hero class while sprite was moving, it didn’t. So I assumed that the new hero position was being calculated in the postupdate and the updatePosition() was receiving old data.
But maybe it was just lucky.
I will never find myself so big thanks again !!
Now I have my player’s animations doesn’t work but I will try to fix it …
For the animation on a extended sprite class you need:
preUpdate(time, delta) {
super.preUpdate(time, delta);
}
Perfect ! Thank you !!
I will show you the result
Have a nice day and great thanks