I'm messing with the Earthball example and I want to make the ball respawn (move to a new point on the z-axis) when it's z-coordinate is below a certain value. Can I do this by using a piece of code like;

under function main()

if eBall.z < -100
{eBall.z = 500;}

eBall is the pointer for the entity

or do I have to create an action and attach it to the entity?

if I have to attach an action how do I do that after the entity is already created? Meaning, what is the function to attach an action to an already created entity?

I know this is incredibly simple but my mind isn't working today...