[SOLVED]How I can find the height to a object..

Get help using Construct 2

Post » Fri May 03, 2013 4:06 am

I am trying create special effect with height, where an object can broken if it is to different height, but I don't have a good idea about this, I have many ideas but they are not efficient I think. I would like know if someone can guide me? this is a example:


height por shimozurdo, en Flickrshimo2013-05-05 03:54:57
B
14
S
4
G
2
Posts: 109
Reputation: 2,679

Post » Fri May 03, 2013 4:36 am

From my understanding, you're wanting an object to break if it falls from too high of a height, correct? I think you're over complicating this by wanting to get the height an object has fallen from. Instead, I would just check the Y velocity(Object.Physics.VelocityY) of your physics object - if the velocity is greater than your designated threshold, break the object.

If you're not using physics, the same concept applies - simply check your Y speed/velocity.linkman20042013-05-03 04:37:58
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Fri May 03, 2013 5:43 am

Exactly! is was my first intent, calculate velocities instead calculate distances, but there is even complications because for any reason sometimes the velocity loses logic or coherence. Is hard to explain..
B
14
S
4
G
2
Posts: 109
Reputation: 2,679

Post » Fri May 03, 2013 5:55 am

Do you have an example file I could take a look at? I might be able to help you out in that case, see what's up.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Fri May 03, 2013 11:33 pm

B
14
S
4
G
2
Posts: 109
Reputation: 2,679

Post » Sun May 05, 2013 3:52 am

Well, I have solved it. the main problem is that the collision with physic do not work well, I dont know why. When an object collision with other and both have physic then you are catching the current velocity and if you trying compare to collision to both objets in that instant the collison sometimes not occurs in the moment of the velocity expected. whatever!
A solution I found is use a sprite auxiliar which detecte the collision but HAVE NOT the physics behavior, so this sprite auxiliar is largest in size that the object with physic.


physic por shimozurdo, en Flickr
B
14
S
4
G
2
Posts: 109
Reputation: 2,679


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 23 guests