Search Unity

Register early Ceiling hits before the real hit.

Discussion in '2D' started by popeye1, Jan 31, 2015.

  1. popeye1

    popeye1

    Joined:
    Dec 19, 2014
    Posts:
    28
    Im making a simple Mario platformer with real physics.
    I want to be able to see if Mario will collide with a specific object immediately when Mario is jumping
    since I know Marios jump path. (parabel function).

    I don't want to use simple collision/trigger handling to solve this problem since colliders will be disabled / enabled depending on if Mario will hit a specific object. And Im guessing its better to calculate if Mario will hit the roof One time instead of checking every frame. (can be between 15-40 frames before the hit really occur.)

    But in short I want to be able to know if Mario will have a future hit in the ceiling given that I know start velocity,acceleration, mass ,position as well as the specific object position. Would be very happy if code is shared as well!!
     
    Last edited: Feb 2, 2015
  2. popeye1

    popeye1

    Joined:
    Dec 19, 2014
    Posts:
    28
    Would be great if a moderator could move this problem to the Physics forum