Hi, im trying to set the location of my test character called test(), after switching worlds. I do this by letting the test character touch the HappyPortal() class to switch to the happy world and i use the StartPortal() class to twitch back to the starting world called MyWorld. I tried using the setLocation(); command, but somehow the test object is at the start location after switching back to starting world from the happy world. Can someone help me with this???
public void switching(){ if (isTouching(HappyPortal.class)){ Greenfoot.setWorld(new NewWorld2()); } if (isTouching(StartPortal.class)) { Greenfoot.setWorld(new MyWorld()); setLocation(100, 200); } }