Quantcast
Channel: Answers for "How to Lerp a position along one axis only?"
Browsing latest articles
Browse All 4 View Live

Answer by instruct9r

It gives error, because on C# you can't access only one axis. Create a temrorary variable and lerp it, then assign it to the local position. void OnTriggerStay(Collider other) { Vector3 newPosition =...

View Article


Answer by Dhiru

you can't set Z value directly. You have to use its positions. void OnTriggerStay(Collider other) { other.transform.localPosition = new Vector3(other.transform.localPosition.x,...

View Article

Browsing latest articles
Browse All 4 View Live