x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

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

4) 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.

Product Version: UE 4.11
Tags:
mesh.jpg (50.6 kB)
more ▼

asked May 03 '16 at 12:07 PM in Blueprint Scripting

avatar image

romadoma
96 2 5 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered May 03 '16 at 02:51 PM

avatar image

Higuy8000
183 11 12 28

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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?

more ▼

answered May 03 '16 at 03:08 PM

avatar image

romadoma
96 2 5 9

avatar image Higuy8000 May 03 '16 at 05:29 PM

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.

avatar image romadoma May 05 '16 at 07:55 AM

So, I've posted it in a Bug Reports section - hope that someone can deal with it - https://answers.unrealengine.com/questions/415770/problem-with-call-setstaticmesh-on-component-in-bl-1.html

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question