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

0 favourites
  • 6 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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 Flickr

  • 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.

  • 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..

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)