Referencing a variable between external events?

hello I have an external spawn event that I have setup to create a ghoul at ether ether the top or bottom of the screen randomly using a variable “ghoulspawn” 1 or 2 which works but when I go to the ghoul external event I want to move ether up or down depending on the “ghoulspawn” variable selected on the spawn event?

ghoul

spawn

I’m assuming you’re linking the external event in the same scene where you’re setting “ghoulspawn” value. As long as your external event has that scene associated with it, the variable should be available and accessible.

thanks for the reply. I wasn’t sure if that was the case but now have it working after changing to object variables. I think this could be cleaned up but works perfectly fine.

spawn event

ghoul event

Just as an observation, you could set the object variable ghoul to be either -1 or 1, rather than 0 or 1. Then your move event can be reduced to one repeat & action: