Is there any way to make barriers and that to prevent the character to going past it?

I am working on a game where you control a circle to safety before enemies kill you.
A small problem is that i need some barriers

I’m new to Wick so any help would be appreciated.
Thanks!

hi @skysoepic
There is an answer that might be helpful here…See the last few entries in the discussion.

The script that the post showed didn’t work and my character just goes past the barrier.
Help?

hi @skysoepic
please upload your script and I will look at it. Probably not much wrong. Did you make your barrier a clip and name it?
that name goes in here…
if(this.hitTest(wall1) ) {
this.x -=10; // stop moving right
}

This test assumes the object hits the wall from the left. You need similar code if the object is travelling from the right. I would create a new wall next to the left wall, call it wall2
if(this.hitTest(wall2) ) {
this.x += 10; // Stop moving left
}