Accessed none trying to read property

Hi Guys,

I’m currently working on a VR flight simulator type game, but my issue is when I move the blueprint actor (Yoke) to get it’s roll/pitch/yaw to rotate the vrpawn, it gives me 0.0 values and Accessed None error when I try to refer to those values in my Vrpawn. See error below.

This is my blueprint code that is working to Get and Set the Roll/Pitch/Yaw of the grabbed Yoke/Steering wheel.

It works fine here as you can see by the changes in Roll/Pitch/Yaw values:

The below screenshot shows my simple blueprint code to print out the Roll, Pitch, and Yaw values.

When L is pressed, it is giving me 0.0, 0.0, 0.0 values for all three Roll/Pitch/Yaw float variables, even though these variables seem to be set and saved correctly in BP_Yoke blueprint. Why is it not updating for my vrpawn?

Thanks

Where are you setting the reference to BP Yoke?

I have it set in the vrpawn actor.

That is where you declared the variable type, but you aren’t actually setting the variable to reference an object instance. You need to drag the variable into the blueprint graph and “Set” it to an existing object instance so that the variable references that object instance. In other words, after you spawn the BP Yoke actor, you would set the variable to the spawned BP Yoke actor.

I tried setting it in vrpawn and it still didn’t work. I found a tutorial where I just used a custom event to get the actors ( BP Yoke ) and set the copy to BP Yoke ref. ( see below )

It seems to work. I have no idea why it wasn’t working any other way, but I guess I’ll start doing this from now on! haha

I appreciate the help!

1 Like

Keep in mind this will work in this case because you only have 1 instance, but as soon as there are multiple instances this will not guarantee you get the right one. If you are placing an actor in the world directly, and not explicitly spawning it from inside a blueprint, you would need to get the instance from the level itself. Just for future reference.

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