Hello! My prefabs always spawn in positions like this.
This is how I’m calling the prefab. Any idea why it keeps spawning in this position?"
tamarawImage = Instantiate(enemyTamarawImagePrefab, new Vector3(460, 130), Quaternion.identity);
Hello! My prefabs always spawn in positions like this.
This is how I’m calling the prefab. Any idea why it keeps spawning in this position?"
tamarawImage = Instantiate(enemyTamarawImagePrefab, new Vector3(460, 130), Quaternion.identity);
You are providing very little information here in order for us to help you, however this issue can occur due to various reasons. One of them might be related to the scale of your instantiated object or the parent GameObject to which it belongs. The scale or position of your parent GameObject can sometimes affect the children GameObjects’ position and scale. This happens because the child GameObjects’ transformation is relative to the parent GameObject.
Another reason could be due to different scaling factors or units used between the Unity environment and the modeling software used to create the object. This is especially true if the GameObject was imported from a 3D modeling software. Make sure to check the import settings of your model in Unity.
If neither of the above-mentioned solutions solves your issue, then it could be due to a script that’s affecting the instantiated object’s position and scale. Check if there are any scripts attached to your object that could modify these values.
in your case:
tamarawImage = Instantiate(enemyTamarawImagePrefab, new Vector3(460, 130), Quaternion.identity);
You are spawning the GameObject ‘enemyTamarawImagePrefab’ at position (460, 130) with no rotation. If the values you’re getting are different from the ones you specified, then it’s probably due to one of the issues mentioned above.
If you’re still having issues, please provide additional information or context for further assistance.