I have following code after I spawn a bullet:
const angleDict = { "up": -90, "left": 180, "right": 0, "down": 90 };
const player = runtime.objects.PlayerFamily.getFirstInstance();
console.log(player);
const playerAngle = player.instVars["direction"] || "up";
const bulletAngle = angleDict[playerAngle] || 0;
const bullets = runtime.objects.Bullet1.getAllInstances();
const bullet = bullets[bullets.length - 1];
// bullet.angle = bulletAngle;
bullet.behaviors.Bullet.angleOfMotion = bulletAngle;
console.log(player, playerAngle, bulletAngle, bullets, bullet);
And player has a 4-directional behavior, which toggle its `direction` variable.
Everything goes well for `left` and `right` direction (bullets flies in right direction) but fails for `up` and `down` - even though console logs proper angles etc. it keeps flying only left or right - can someone help?