Pages 1
Universal Fighting Engine Forum We are no longer using the forum to answer questions due to bot attacks. Please use our discord instead: https://discord.gg/hGMZhF7 |
You are not logged in. Please login or register.
Universal Fighting Engine Forum → 2D Gameplay → Limit how high a character is hit
No you can't limit how high a character goes.
You could limit how high the camera goes, custom code is needed for that tho.
No you can't limit how high a character goes.
You could limit how high the camera goes, custom code is needed for that tho.
Yeah, that's what I need. I need to limit how high the camera goes. Where can I go to look up how to do it?
You could just check if the camera's Y position is greater than a certain value.
I didn't test this code
using UnityEngine;
public class Test : MonoBehaviour
{
private Transform myTransform;
[SerializeField]
private float maxYPosition;
void Awake()
{
myTransform = this.transform;
}
// Update is called once per frame
void Update()
{
if (transform.position.y > maxYPosition)
{
myTransform.position = new Vector3(myTransform.position.x, maxYPosition, myTransform.position.z);
}
}
}
@FreedTerror: It works great! I attached it to my camera! Thank You!
Universal Fighting Engine Forum → 2D Gameplay → Limit how high a character is hit
Powered by PunBB, supported by Informer Technologies, Inc.