✅ Need help with C# unity game development.
The issue I have is that im getting reference null on this line:
itemParentObjectTransform.transform.parent = playerController.transform;
Any help appreciated!
5 Replies
$code
This part was working earlier if i had transform.position and not transform.parent
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/if changing transform.position to transform.parent is giving you an object not set to ref error, that means that the transform you're referencing doesn't have a parent.
so you have to assign it
is how I referenced it.. Not sure ?
lol sorry I was looking at the wrong script omg it was a little further down the line. I hadn't referenced the player
Thanks for the help!