on-internet
← Community

Position of game object not updating

Stack Overflow ·

So I'm making a game in Unity and I'm trying to add an enemy that covers the screen as it takes damage. The formula I'm using should work exactly how I want it to except when I use transform.position the position doesn't change at all. Here's the code: using UnityEngine; public class DaedalusPositioner : MonoBehaviour { public static DaedalusPositioner Instance; public int daedalusMaxHealth; public int daedalusHealth; private float number = 7.5f; private void Awake() { Instance = this; } private void FixedUpdate() { gameObject.transform.position = new Vector3(0f, number, 0f); } public void Upd

Comments

Sign in or sign up to comment and upvote.

No comments yet.