Sphere Collision overlap event not working
So since I can't change Peripheral Vision Angle in BPs I decided to try adding a Sphere Collision to my Flashlight BP in the shape of the spotlight cone radius and added an Overlap Event when it hits my Enemy BP, so that the enemy chases the player.
For some reason it's not working. I believe it's something stupid, but naturally I can't see it.
asked Dec 23 '17 at 09:42 PM in Blueprint Scripting
Your Overlap event is failing at the Cast to BP_Enemy node. Not only your Object references are invalid, your nodes are not fully connected. In order for it to work, the white curve which indicates the execution flow must first go through Cast To BP_FlashLight node. Then you should connect its output execution pin to Cast To BP_Enemy and so forth. At this point, you should see the Hello message printed on your screen but your AI Move To node will fail as both Pawn and Target actor are invalid and will never fire. You need to first tell those two nodes what their Input Objects are, as well as making sure that they are executed by passing the execution flow through them. Alternatively, you can first do all your casting when the Overlap event fires, save the output of each of those Casts in a separate variable, and then use those variables. If you don't want to do that and you're sure that your Casts will never fail, you can right click on them and convert them to Pure cast (However, I don't recommend doing this for now unless you know what you're doing.)
i think the white pin from the overlap event needs to go into the cast to BP_Flashlight
answered Dec 24 '17 at 02:11 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here