Instead of flaming everyone, read this topic: About the Scripting Support category.
You need to show more code, and not in screenshot form. We said that it’ll be nil if your mouse is over the skybox because there isn’t an object.
It’s even worse when you decide to be immature about the answers. Instead of acting like a toddler, I suggest you edit your reply to be more appropriate and polite to the conversation.
I’m stating the obvious here, Mouse.Target will return nil when it’s pointed towards the skybox.
But by the lack of code you have shown us, I would think it would be something outside of this check. Would I be correct that to say that this is wrapped in an event? It would be nicer to see more code rather than a screenshot of two lines.
EGebAHBEH it seems like you’re very chidlish eEeEe!
Please refrain from writing posts like this because it makes people not WaNT tO heLP yOu ( no offense EHebA )
Your issue is that target is probably becoming nil after the check, please do consider that you refrain from such childish acts on this forum.
I would suggest putting Mouse.Target as a local then checking if it exists.
After a quick internet search and attempting to reproduce your error, you’re indexing nil with ‘Name’ ( mouse.target ) so do my suggestion and it should work.
I don’t think you really understood what I was trying to come across.
That code could run each time the mouse moves; so it doesn’t only run once.
But by saving or making a variable point to the mouse’ current target, we can be assured we can do whatever we want with that object for the rest of the conditions we want to test, or whatever else we want to do. By doing this we know there’s not a chance it could become nil at some point later in our code