Hello
I’m novice in Unity3D, and I have a question concerning the movement 2D objects
I wanted to know is it possible to make the movement of the character, not only in the X, but also along the axis Y? (respectively with the correct texture: face and back view)
And is it possible to increase / decrease the size of the hero when you move up / down?
Here is the script, which is used for character movement along the axis X:
using UnityEngine;
using System.Collections;
public class CharacterControllerScript : MonoBehaviour
{
public float maxSpeed = 10f;
private bool isFacingRight = true;
Animator anim;
void Start()
{
anim = GetComponent();
}
void FixedUpdate()
{
float move = Input.GetAxis(“Horizontal”);
anim.SetFloat(“Speed”, Mathf.Abs(move));
rigidbody2D.velocity = new Vector2(move * maxSpeed, rigidbody2D.velocity.y);
if(move > 0 !isFacingRight)
Flip();
else if (move < 0 isFacingRight)
Flip();
}
void Flip()
{
isFacingRight = !isFacingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}
Also I have a question about camera
Can I put some borders in areas where the camera stop follow the main character, but the character continues to move until you get to another area?
Help, please
I would be glad for any help :sad:



