Edit: Managed to fix this issue. For the benefit of anyone who may be facing this prob in the future:
I tried to have the code like this initially
On player wall collide - stop player
if player.X is < wall.X - player.x = wall.x -50
add a force -20 to X axis
if player.X is > wall.X - player.x = wall.x +50
add a force +20 to X axis
That for some reason, that gave the above problem. Solved it by putting the 2 sets of conditions to their own sets:
On player wall collide
if player.X is < wall.X - stop player
- player.x = wall.x -50
- add a force -20 to X axis
On player wall collide
if player.X is > wall.X - stop player
- player.x = wall.x +50
- add a force +20 to X axis
Ok, but now i’m trying to do a similar thing with player - enemy collision and only one side works again.
Attached is the actual code. Player wall code in the image works but doesn’t work with player - enemy collision
Conditions: If player collides with wall/enemy
Actions: Stop object player
Separate player from wall/enemy (only player will move)
Other than that, I don’t know why your code would work for walls but not for enemies
Could it simply be that it should be “Center”, not “Centre”? I think I’ve been caught out by that before. Not quite as infuriating as when you’ve typed “Yes” instead of “yes” though!