Find nearest Actor, rotate turret

Hi so i’m having two issues one is i’m getting an error ( Blueprint Runtime Error: “Accessed None trying to read property CallFunc_FindNearestActor_ReturnValue”. Node: Set World Rotation Graph: EventGraph Function: Execute Ubergraph BP Player Turret Blueprint: BP_PlayerTurret. ) Which I can’t figure if placing a isValid would fix and if so where. The second is that the Turret when rotating is not facing me, this is not due to the original starting position.( so i’m guessing I could use better blueprints for what I want to achieve.)

Hey @Proloke! Welcome to the forums!

We’d love to help you with this- but your image didn’t post! :open_mouth: Try to edit it and repost it- check the preview window to make sure the image is there! :slight_smile:

okay done, thank you!

“Accessed None trying to read property CallFunc_FindNearestActor_ReturnValue”

You are accessing variables from another event. To fix this:
OnPreceptionUpdate → Save UpdatedActors as an array variable
OnTick → If UpdatedActors is greater than 0 → Do what you do but link to the array variable instead from other event

The facing issue should be fixed if there are actually Actors to get from.

2 Likes

Kiray is right!
You can promote that Updated Actors to a variable, which then you can use to check if Length >0. Then do nothing if it is not greater than 0:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.