Search Unity

2D intersections for Sprite lerp

Discussion in 'Physics' started by Graph, Feb 13, 2016.

  1. Graph

    Graph

    Joined:
    Jun 8, 2014
    Posts:
    154
    So i ran into an interesting problem here..
    I'm trying to fake a softBody sphere on mobile devices. I've got a sequence of sprites going from no over full back to no collision. My initial idea of how to solve this was with collider intersection tests. get the intersection points on the 2 colliders, rotate the sprite gO by the normal and lerp the sequence item by the distance..

    Unfortunately though i was not able to find the needed functionality in the physics api. Any ideas?

    Technically i could make this work with a single rayCast(not good but at least something) if i got the closest point to the colliding object on it's aabb.
     
    Last edited: Feb 13, 2016