Hello everyone, I currently have an Object that’s moving around a background(which is a sprite.) This is how the object moves.
The idea of movement is Gameboy Zelda style. I’ve created a small HUD with arrows.
(the movement script is attached to the player…)
If up arrow is clicked
transform.Translate (Vector3.up * speed * Time.deltaTime);
If down arrow is clicked
transform.Translate (Vector3.down * speed * Time.deltaTime);
If left arrow is clicked
transform.Translate (Vector3.left * speed * Time.deltaTime);
and so on…
Now I want to accomplish :
- Don’t move the player if the limits of the bounding box of the Background
sprite are reached.
I haven’t started to do any scripts because I honestly am blank on how to start tackling this problem thats why I come to you for help.
If you think I should change the way the object moves please let me know why, and what to modify it to.
Thank you for your time and hope hearing for your answers.