i'm currently making a game and seem to get an error saying "Actor not in world. An attempt was made to use the actor's location while it is not in the world...."Can someone please help asap
What does it mean


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | import greenfoot.*; public class Fireball extends Player { private int direction, speed; public Fireball( int dir) { direction = 270 ; speed = 15 ; } public void act() { setRotation(direction); move(speed); disappear(); } public void disappear() { Actor BugEnemy; BugEnemy = getOneObjectAtOffset( 0 , 0 , BugEnemy. class ); Actor InsectEnemy; InsectEnemy = getOneObjectAtOffset( 0 , 0 , InsectEnemy. class ); Actor Bee; Bee = getOneObjectAtOffset( 0 , 0 , Bee. class ); if (BugEnemy != null ) { World world; world = getWorld(); world.removeObject(BugEnemy); world.removeObject( this ); } if (InsectEnemy != null ) { World world; world = getWorld(); world.removeObject(InsectEnemy); world.removeObject( this ); } if (Bee != null ) { World world; world = getWorld(); world.removeObject(Bee); world.removeObject( this ); } else { if (atWorldEdge()) { getWorld().removeObject( this ); } } } } |
1 2 3 4 5 6 7 | if (BugEnemy != null || InsectEnemy != null || Bee != null || atWorldEdge()) { getWorld().removeObject( this ); } |
1 2 3 4 5 6 7 | if (BugEnemy != null || InsectEnemy != null || Bee != null || atWorldEdge()) { getWorld().removeObject( this ); } |
1 2 3 4 5 6 7 | if (BugEnemy != null || InsectEnemy != null || Bee != null || atWorldEdge()) { getWorld().removeObject( this ); } |
1 | public boolean moveEnemies( int direction) |
1 | public void drop() |