2d beat em up

Started by
11 comments, last by Nikolasi 7 years, 1 month ago

This forum aims to teach you how to solve your own problems. In particular, it is not a "code my program" or "debug my program" site.

Instead of just dumping a video, the code, and try to let us do your homework, why not have a go at it yourself, and ask specific questions on where you get stuck?

Advertisement

Script isnt completed.
Look:
[video=youtube]https:
[/video]
Script:
Code need debug.

Right now you're just setting the Player's Z to -1 when he's below the other object. It's never being set to another value, which is why he's always in front (he should be behind before moving when his Z is 0, but I guess your other object has a Z of 0 or higher).

This system isn't very robust either since you're making a direct check between two specific objects. Just set every object's Z-position equal to the position of its feet (position.y if origin is at bottom, position.y - height if origin is at top). You can hard-code this into the scene for static objects or do it in code, which is necessary for anything that moves.

If any one can fix it will be great:

https://www.dropbox.com/sh/efekdepadgs8949/AACTz-JkBjKqP87Fr1ciM3Fya?dl=0

open main scene in folder scenes

This topic is closed to new replies.

Advertisement