How do I set max movement?

Get help using Construct 2

Post » Thu Sep 17, 2015 10:26 am

Hi all!

I'm just wondering if there is a way to limit the parameters of an action?
What I looking for is kinda like the "move at angle" action, where you can choose angle and distance, but I need an expression to basically say that if the object is moving towards a position under 200 pixels away, it will go the whole way, but if it's further than 200 pixels away, it will only move 200 pixels towards it.

Sorry if this is a touch vague, it's just something I haven't encountered before! XD

Thanks in advance everyone! :D

Regards,
Gideon
B
10
S
1
Posts: 72
Reputation: 1,019

Post » Thu Sep 17, 2015 1:37 pm

You mean something like the clamp expression?

clamp(x, lower, upper)
Return lower if x is less than lower, upper if x is greater than upper, else return x.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Christmas and 26 guests