Skip to main content

Timeline for nullException issue [duplicate]

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Jun 5, 2017 at 15:02 history closed Gnemlock
doppelgreener
Engineer
user1430
Duplicate of NullReferenceException in Unity
Jun 5, 2017 at 10:06 history edited doppelgreener CC BY-SA 3.0
edited title
Jun 5, 2017 at 8:03 review Close votes
Jun 5, 2017 at 15:02
Jun 5, 2017 at 2:01 comment added DMGregory Which line do you think is initializing plyC, @Jihen007? There's not a single plyC = ... anywhere in what you've shown - and since it's private and not marked [SerializeField] it wouldn't show up to be populated in the inspector either. So it looks like it would still have the default value of null that reference type variables get when they're declared. How do you intend to tell this code which playerController should perform the Attack() action?
Jun 5, 2017 at 0:50 answer added Vaillancourt timeline score: 2
Jun 5, 2017 at 0:34 comment added Jihen007 post Edited ...
Jun 5, 2017 at 0:27 history edited Jihen007 CC BY-SA 3.0
added 189 characters in body
Jun 5, 2017 at 0:08 comment added Vaillancourt I would just answer 'No' but that would be rude :P If it were properly initialized, you would not get that exception. Please edit the post and add the code where you think plyC is initialized!
Jun 5, 2017 at 0:06 comment added Jihen007 I initialize it in 'mainmanager' as private playerController plyC
Jun 5, 2017 at 0:04 history edited Jihen007 CC BY-SA 3.0
added 6 characters in body
Jun 5, 2017 at 0:03 comment added Vaillancourt And where/how do you expect plyC to be initialized?
Jun 5, 2017 at 0:01 history asked Jihen007 CC BY-SA 3.0