Not really sure what the problem is but this node isn’t being called? does anyone know what would cause this node not to trigger? I can’t get my flashlight working.
A few possible reasons…has flashlight could be returning false, the spotlight could be returning invalid (maybe setup print nodes to check for those) also calling the client function at the end of the flip flops is unnecessary as calling the server event calls the client event, this could be creating a loop that’s producing an undesired result
I put a print string on is valid and is not valid its coming back as is not valid so I’m guessing I’m not setting a proper reference. How can I fix this problem?
Well for one, in the BP you posted, the reference is being set after the valid check. Also is there any other places in your code this reference is set? Also calling “get actor of class” may produce better results than casting, for if the cast fails the reference won’t set.
What is the “actor reference” your plugging into the cast? Id think you want to plug in that spotlight reference or better yet like I mentioned use “get actor of class”
That actor ref is what a guy on YouTube told me to do when casting to an object. He said that it’s just asking you to be more specific as to what you’re casting too. In my case bp_flashlight “actor”. I’m still learning. But yeah, it’s all good. I’ll try using get actor of class. Thanks for the help.
Got it, I’m curious, if the actor reference is to your BP flashlight class, what is the “spotlight” object reference to?
Spotlight was a reference to the spotlight in BP_Flashlight.
and get actor of class is working sort of. but now its triggering (Flashlight 0) when I have a (flashlight 2) equipped. (flashlight 2) doesn’t turn on/off at all. And (flashlight 0) turns on / off in the world as long as you have (flashlight 2) equipped.
What type of actor is the actor reference? If it’s set to a bp_flashlight object reference you should be able to access it’s functionality directly, without even the get actor call…is the above BP in your bp_flashligt or is this in a characters class BP?
Does it work if you only have 1 flashlight equipped? I’m a little confused with the 2 flashlight thing, is one like a local and the other is a server?