Problem with call SetStaticMesh on component, in Blueprint

Hi everyone!

I have a problem with using function SetStaticMesh in Blueprint. Here is the situation:

  1. I have a car actor with 4 wheels as its components (car body + 4 wheels.) Wheels are called WheelA, WheelB, WheelC, WheelD. Wheels ARE NOT instanced static mesh, but just a StaticMeshComponent. All of these wheels have a model BlackWheel.uasset.

  2. Somewhere in my Blueprints I’m calling SetStaticMesh on one (or all) of car’s wheels to change them to red ones (set up a RedWheel.uasset model.) Like on picture below.

  1. It works fine - wheel model is changed I can see it during test gameplay.

  2. BUT when I’m returning to Viewport-Perspective in Unreal Engine, - what I see is that all of car wheels are RedWheel.uasset for now! This looks like engine remembers that new RedWheel were set via Blueprint and now displays it in Viewport. IN GAME: there is still BlackWheel - and everything is works fine, but RedWheel is displayed in Viewport - it’s really annoying, cos’ if car has black wheels, I want them to be black, not red! ALSO, if click on wheel in Viewport and look into Details->Static Mesh section, there is still BlackWheel asset is selected, despite that RedWheel is displayed in Viewport screen!

Is this some kind of a bug? Or there is some kind of cache in Unreal Editor which I can clear to reset actors to their default state?

P.S. There is the same problem with DestroyComponent func. When it called via Blueprint on some component, this component is no longer shown in Viewport of actor, but you can still see its name in components list; when clicking on it’s name, it’s highlighted in viewport but no model is displayed on screen (only 3 arrows, RGB.)

It looks like editor remembers actions that has happened to component in blueprints! Editor restart doesn’t helps - changes are still visible in Viewport.

Thanks for any help with this annoying problem.

Where are you calling the SetStaticMesh function in your blueprint?

A quick solution to this could also just be in your construction script to call SetStaticMesh and set it to the black wheels. That way whenever they are initially created, the wheels will be black.

Then in a function or somewhere later (like pressing a button), call the code you have above to change it to the red wheels.

If that’s already what you are doing though, that definitely sounds like a bug.

Thanks!

Where are you calling the SetStaticMesh function in your blueprint?

No matter where - this all gives the same result. In current scenario SetStaticMesh is called NOT in ConstructionScript.

A quick solution to this could also just be in your construction script to call SetStaticMesh and set it to the black wheels. That way whenever they are initially created, the wheels will be black …

They are already initially black, even if they’re red in editor’s viewport. I mean this kind like an editor bug - incorrect models are appears ONLY in editor’s viewport, not in test gameplay.

If that’s already what you are doing though, that definitely sounds like a bug.

What should I do in this case? Can I report somewhere to UE developers team?

Ah so it still functions as intended when playing, thats good.

Yeah this sounds like a bug. If you go and post a new question, you can file it under the section “Bug Report”. Might be best to repost it as a bug and list some repo steps so they can get into their bug database.

So, I’ve posted it in a Bug Reports section - hope that someone can deal with it -