# Velocity VS Sleeping

Discussion and feedback on Construct 2

### » Fri May 10, 2013 8:53 pm

Can someone please explain the difference between Velocity X = 0 & Velocity Y = 0, and physics sleeping?

I have an object that I want to fade out when it is not moving at all... which I thought sleeping did. It doesn't work. I then tried to compare Velocity X and Y, but the conditions were not there. I therefore had to create variables to store these values (which I thought was a bit odd), and set up an event which fades the object out when the X & Y both equal 0.

This works.

So yeah, please can someone tell me the difference, and why there aren't simply conditions to check the object's current velocity?

THANK YOU!!!
B
95
S
19
G
8
Posts: 1,035
Reputation: 12,521

### » Fri May 10, 2013 11:07 pm

What objects really need is the 'pick by comparison' condition that CC has. Then you can just plop in any expression an object has and compare it.

Unrelated, but it would also be nice to have an expression for an object's scale. Arima2013-05-10 23:09:51
Moderator
B
96
S
34
G
33
Posts: 3,007
Reputation: 27,911

### » Fri May 10, 2013 11:12 pm

And Opacity
B
95
S
19
G
8
Posts: 1,035
Reputation: 12,521

### » Sat May 11, 2013 12:42 am

What object are you referring to that doesn't have an opacity expression/condition?
Moderator
B
96
S
34
G
33
Posts: 3,007
Reputation: 27,911

### » Sat May 11, 2013 3:10 am

Oops, my bad... Not sure why I thought that wasn't there.

Still, do you happen to know the difference between velocity equalling zero and sleeping?
B
95
S
19
G
8
Posts: 1,035
Reputation: 12,521

### » Sat May 11, 2013 3:50 am

AFAIK the difference between sleeping/velocity at 0 is like the difference between setting an object's opacity to 0 and setting it to invisible. If it's visible with the opacity at 0, the graphics card still does all the work of rendering it. If it's invisible, it skips rendering it completely - though the object still has some overhead so enough sleeping objects will still affect the framerate eventually. I think it's similar to that for the inclusion of which objects are calculated by the physics engine.

(I'm not entirely sure about that, but that's how I think it works.)Arima2013-05-11 03:51:42
Moderator
B
96
S
34
G
33
Posts: 3,007
Reputation: 27,911