So I’m encountering an issue with an instantiated prefab object that I don’t encounter with objects already present in the scene when I hit “play”, as follows:
Vector2 dirToPlayer = (player.transform.position - transform.position).normalized;
rigidbody.velocity = dirToPlayer * speed;
print("Velocity SHOULD be - " + (dirToPlayer * speed)); // Always prints expected value
print("Velocity ACTUALLY is - " + rigidbody.velocity); // Matches value printed above for objects present in scene at launch, ALWAYS zero for object instantiated during runtime
I’ve double/triple/quadruple checked to make sure instantiated objects have all the correct values and settings. Any ideas as to why this may be occurring would be appreciated, thank you.