Closed laurentopia closed 1 month ago
Hi,
Can you check if you mean GetComponentInParents
than GetComponentInParent
?
For what I tested:
public class Issue43 : MonoBehaviour
{
[GetComponentInParent] public MCUnit mcUnit;
}
Ensure I'm in prefab editing mode:
Attach MCUnit
to PR_lankyman
Then attach Issue43
to it's directly children:
Both lankyman
(a normal GameObject) and lankyman (1)
(a prefab) works as expected
So maybe your MCUnit
is not direct parent of your GetComponentInParent
, thus you need GetComponentInParents
If not, please tell me where your GetComponentInParent
attached in your screenshot so I can try re-produce this issue.
I think it was problem with HotReload breaking things again. It works as expected now, but sometimes not due to HR intercepting stuff.
[GetComponent] works fine, tho
![image](https://github.com/TylerTemp/SaintsField/assets/26075468/cebc4b0b-9ec4-4fd8-bee2-516f0ee76170)