Friday, June 19, 2015

Unity: Restrict movement inside a gameobject (2D)


I've been sort of trying my own thing but it's super buggy so I'd like to see what other people have done to create moveable spaces. In essence, I just want to restrict my character's movement to inside of a sprite. So one of my sprites is the character and another one of my sprites is a box -- I want to make it so my character can't leave the box. I've been modifying transform.position on mouse click in order to move my character, but now I'm not sure if this was the smartest idea.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...