This site requires JavaScript, please enable it in your browser!
Greenfoot back
BimBom46
BimBom46 wrote ...

2020/1/23

If i want to remove a object when it touches the World Edge the game crashes

BimBom46 BimBom46

2020/1/23

#
public void Border1()
    {
        if (isAtEdge())
        {
            getWorld().removeObject(this);
        }
    }
When it crashes, it says : java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed. Under that are two red marked text : at Bullet.Spielerentfernen1(Bullet.java:26) at Bullet.act(Bullet.java:21)
You need to login to post a reply.