# How do I stop an object from moving?

Get help using Construct 2

### » Fri Jul 04, 2014 2:34 pm

I am making a breakout game,and need to stop the paddle when it touches walls,i thought this would be very simple,but i can't figure out how to do it...another thing,i can not use bound to layout,because layout is larger.So i need another solution.
B
5
Posts: 24
Reputation: 280

### » Fri Jul 04, 2014 2:55 pm

You can add invisible wall on left and right side with solid behaviour or the wall you said set behaviour to solid
B
265
S
49
G
15
Posts: 2,028
Reputation: 42,733

### » Fri Jul 04, 2014 8:06 pm

Lordshiva1948 wrote:You can add invisible wall on left and right side with solid behaviour or the wall you said set behaviour to solid

It is a solid....and the paddle still goes trough it.
B
5
Posts: 24
Reputation: 280

### » Fri Jul 04, 2014 10:14 pm

Just use clamp()

clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

### » Fri Jul 04, 2014 11:19 pm

granpa wrote:Just use clamp()

clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.

I don't know how to do that...i am beginner,do i do it in event sheet? If so,how?
B
5
Posts: 24
Reputation: 280

### » Fri Jul 04, 2014 11:49 pm

Lets say you are controlling the paddle with the mouse and the furthest the paddle can go to the left without hitting the wall is 40 and the furthest right is 500,,,,,,,,
make a condition and action as follows :
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

### » Sat Jul 05, 2014 12:41 am

granpa wrote:Lets say you are controlling the paddle with the mouse and the furthest the paddle can go to the left without hitting the wall is 40 and the furthest right is 500,,,,,,,,
make a condition and action as follows :

Thanks
B
5
Posts: 24
Reputation: 280