Hi this is my first post here, and i am trying to make an object change its color when another object(The Main Actor) is close to it using get getOneObjectAtOffset. This is the code i got so far. Img1 is the Original Image and Img is the one i want it to turn into.
Actor Thing = getOneObjectAtOffset(getImage().getWidth()/2,getImage().getHeight()/2, Main.class);
if(Thing==null)
{
setImage(img1);
return false;
}else{
setImage(img);
return true;
}
Thanks!
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)