2d beat em up
It really helps if you mention Unity too in the title or the tags, very few know what programming system you use.
Dev careful. Pixel on board.
Buckle up. Everything will be revealed.
I try use http://www.coatbros.com/blog/2015/03/ but it dont work.I dont know why.
A line check should work in this case as long as the sprite origins are at the feet, not the center or top. Check in your sprite import settings, or apply the sprite/bounding box height as an offset.
EDIT: Looking at the code, Vector3.Set doesn't work on transform vectors. You have to manually set the entire vector reference to a separate Vector object:
if (transform.position.y > Object.transform.position.y) {
{
// doesn't work
transform.position.Set(transform.position.x, transform.position.y, -1);
// does work
transform.position = new Vector3(transform.position.x, transform.position.y, -1);
}
A line check should work in this case as long as the sprite origins are at the feet, not the center or top. Check in your sprite import settings, or apply the sprite/bounding box height as an offset.
EDIT: Looking at the code, Vector3.Set doesn't work on transform vectors. You have to manually set the entire vector reference to a separate Vector object:
if (transform.position.y > Object.transform.position.y) { { // doesn't work transform.position.Set(transform.position.x, transform.position.y, -1); // does work transform.position = new Vector3(transform.position.x, transform.position.y, -1); }
Object.transform doesn't exist
That was copy and pasted from your original code. Making a new Vector3 is the main point.
Look still dont work: http://i.imgur.com/h17uIzb.png