✅ 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 ?
![](https://utfs.io/f/75a7c816-5df7-4cf0-add9-989e8e728c87-1nq2cb.png)
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!
![Smadge](https://cdn.discordapp.com/emojis/992468507960819803.png)