rabidus-test/Assets/BNG Framework/Scripts/Components/CharacterYOffset.cs

15 lines
492 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BNG {
public class CharacterYOffset : MonoBehaviour {
// This is used to offset a FinalIK character by it's parent. This fixes some positional issues.
void LateUpdate() {
float yOffset = transform.parent.localPosition.y;
transform.localPosition = new Vector3(transform.localPosition.x, -1 - yOffset, transform.localPosition.z);
}
}
}