Jump to content

script property not being read correctly


Rick
 Share

Recommended Posts

I have a project that was working fine until today in a certain area. I have a player script that has a public property at the top: Script.Camera = nil --Entity

 

I have a camera object in my scene that is working fine. I drag that object into my players script Camera property. Then in my player script I call:

 

self.Camera.script:ZoomIn()

 

which was working fine all day yesterday, but today when it tries to run this it says 'attempt to index field 'Camera' (a nil value)'. However in the editor I see the camera in this property field. It shows it's there yet it's nil. I've removed it and readded but I get the same error.

 

I would like to provide this project but it uses purchased models and I have no idea on how it happened so I can't reproduce in a demo project.

 

Josh, if you want to take a look let me know how I can provide this project to you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...