Page 2 of 2

Re: How do I exactly stop the bullet at position ?

PostPosted: Fri Jun 26, 2015 8:25 am
by LittleStain
matrixreal wrote:
R0J0hound wrote:looking at it again you'll probably want width>400 since by subtracting from the width it should be shrinking.

here is what i want exactly
but as i told you always stop at different value
https://www.dropbox.com/s/vrc769cjw12pm ... .capx?dl=0



One way of solving it:

https://dl.dropboxusercontent.com/u/485 ... egrow.capx

Re: How do I exactly stop the bullet at position ?

PostPosted: Fri Jun 26, 2015 9:14 am
by Kyatric
Or simpler based on @LittleStain answer :
Image

This is a question of comparison sign.
As long as the object is less (and ONLY less) than the desired size, you make it bigger.
Once it is bigger (and ONLY bigger) than the desired size, you set it at the desired size.

Without the "or equal" in your comparison, you're making sure the logic works as intended.
You are also making sure that as long as the size is less than the desired size, the object will get bigger. The moment the size is reached, it won't grow anymore.
And you are also making sure that it will be bigger than the desired size only once, since the moment it happens, you set it to the desired size which no event/condition actually acts on anymore.

Replace 80 with any value, and it will work, as long as it is consistent in both events.

Re: How do I exactly stop the bullet at position ?

PostPosted: Fri Jun 26, 2015 9:24 am
by LittleStain
Kyatric wrote:Or simpler based on @LittleStain answer :
Image

This is a question of comparison sign.
As long as the object is less (and ONLY less) than the desired size, you make it bigger.
Once it is bigger (and ONLY bigger) than the desired size, you set it at the desired size.

Without the "or equal" in your comparison, you're making sure the logic works as intended.
You are also making sure that as long as the size is less than the desired size, the object will get bigger. The moment the size is reached, it won't grow anymore.
And you are also making sure that it will be bigger than the desired size only once, since the moment it happens, you set it to the desired size which no event/condition actually acts on anymore.

Replace 80 with any value, and it will work, as long as it is consistent in both events.


Yeah, that's better.. :)
Sometimes I just want it to work and don't bother finding the easiest way, haha..

Re: How do I exactly stop the bullet at position ?

PostPosted: Fri Jun 26, 2015 1:58 pm
by matrixreal
yes thats awesome
thanks