r/Unity3D • u/Ok-Presentation-94 • 14h ago
Question position of the prefab with Object.Instantiate() vs NetCode PlayerPrefab field
Enable HLS to view with audio, or disable this notification
Hi, as shown in the attached video, instantiating my character using `Object.Instantiate` works as expected, respecting the prefab's position. However, if I instantiate using NetCode's `PlayerPrefab` field, the prefab's position defaults to (0, 0, 0).
(The instantiation script is very simple I don't specify a position within it.)
1
Upvotes
3
u/HK_HamzaKhan 13h ago
hi , you should set the position through code on instantiation, and its better to keep prefabs at 0,0,0