I have an NPC moving in the X direction with a speed variable set to 1. When it collides with an object I need its speed variable to be -1 so that it moves in the other direction.
I can hard code this with another variable and have it set to -1 with something like Set Float Value but if I have different enemies set at different speeds (5 to -5) that will also collide with this object it wouldn't work.
How would I do the math / use actions and variables to make this happen?