Download

Hovering Component Blueprint Read Access Runtime Error

Hey,

I have created a Hovering component for my vehicle using Blueprints and using a Line Trace to apply a force to generate lift. My component works 98% of the time, but sometimes I receive the following error:

PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property PrimativeMesh from function: ‘ExecuteUbergraph_HoverComponent_BP’ from node: Add Force at Location in graph: EventGraph in object: HoverComponent_BP with description: Accessed None trying to read property PrimativeMesh
PIE:Error: Error Blueprint Runtime Error: Accessed None trying to read property PrimativeMesh from function: ‘ExecuteUbergraph_HoverComponent_BP’ from node: Add Force at Location in graph: EventGraph in object: HoverComponent_BP with description: Accessed None trying to read property PrimativeMesh

The actor using the component is never destroyed or changed. During BeginPlay the Static Mesh is set by the Pawn class in the component, and for the most part it works fine until enough time has passed it generates this error and the vehicle stops moving an freezes. Is there a reason this is happening? Would the code work better in C++?

Show your Blueprint

Maybe add a breakpoint to an IsValid-node checking for false on PrimitiveMesh at AddForceAtLocation.
See what other factors are at play here keeping the session alive in case its tricky to report / repro etc.

I will try using the valid node see if it helps. This error is hard to debug and only happens here and there.
Also, I have attached my Blueprint now.

Helpful but you really left out the punchline there…
Where and how is InitComponent called (or not)! :slight_smile:

The InitComponent is called in the BeginPlay in my pawn Blueprint.

Ok, so your Pawn sets HoverComponentBP → Primitive Mesh var… (Static Mesh vehicle)

So is there ever a scenario where HoverComponentBP is destroyed, then respawned?
Or can Primitive Mesh be Set or Reset to none somewhere else, if / after Pawn dies etc…
What is it being set to anyway: is the mesh dynamic… might it die / change scope???
(Set-up some breakpoints anywhere Primitive Mesh is Set, or HoverComponentBP is spawned / destroyed etc…)

The actor Pawn, spawns both the HoverComonpentBP and Mesh in its class blueprint. There is no respawning when this error occurs, it happens in one straight play through. Im starting to think it could be another component interfering causing this issue.

There are still some unusual gremlins in the engine…
So definitely breakpoint the code in places to repro…

Maybe in gamemode etc add IsValid breakpoints for:
Pawn / HoverComonpentBP / Primitive Mesh etc etc.
Wait for the fail, then see if you can spot a pattern…

Ok thanks for the input. I’ll try using the method for a bug trace. Im also thinking it might be a gimbal lock with the spring arm , the actor has their rotation set via a line trace so it can be in allign with the floor angle.

Ok thanks for the input. I’ll try using the method for a bug trace. Im also thinking it might be a gimbal lock with the spring arm , the actor has their rotation set via a line trace so it can be in allign with the floor angle. The spring arm has no code added to it. It just inherits pitch yaw and roll from the actor.