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"

[Question] Changing mobility for Components in Blueprint

Is there a way where I can change certain property ( e.g. Mobility ) for SceneComponent via Blueprint?

Product Version: Not Selected
Tags:
more ▼

asked Mar 29 '14 at 05:09 PM in Blueprint Scripting

avatar image

Frozenfire
662 61 84 117

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

3 answers: sort voted first

Hey Frozenfire,

I responded to your bug report here: https://answers.unrealengine.com/questions/22313/bug-no-static-lighting-for-constructionscript-gene.html#answer-22973

See if that solution helps fix the lighting problems you're experiencing when spawning Static Meshes through your Construction Script.

For your other questions:

  • In the same way, by making adjustments in the Details panel for the Add StaticMeshComponent, you can expand the Lighting section and disable Cast Dynamic Shadow.

  • Since you can't change mobility at runtime, you won't be able to move an Actor with mobility set to Static. You might be able to replace it with an identical Mesh set to Movable, but you'll need to experiment with that to see if you get the lighting results you're looking for.

Hope that helps!

Ben Halliday

more ▼

answered Apr 01 '14 at 04:56 PM

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

Hey Frozenfire,

Scene Components don't really have a lot of properties, but you can certainly adjust most of them. Location, rotation, and scale, as well as basic visibility and activation, can all be set via the EventGraph. Drag off a Get of your SceneComponent and you'll have a full list of what you can do with it (if you have Context Sensitive ticked).

Mobility is not something you can change during run-time. Is there a specific purpose you have for that change? If you're looking to make an object movable in your game, you can play with the physics aspect of the mesh via Blueprints instead.

Hope that helps!

Ben Halliday

more ▼

answered Mar 29 '14 at 05:56 PM

avatar image Frozenfire Mar 29 '14 at 07:33 PM

@Ben Halliday

I'm asking this specifically for 3 reasons;

1) I'd like to know if it's possible to spawn a 'static' object on runtime that persists that's level saving. Thus having static lighting. I'm making a procedural building but I'm wondering how would I make it possible that the generated mesh will have static lighting ( assuming that they would only be generated in editor and not in-game ).

2) For the scenario as described in point 1), I am looking for a solution that would allow me to spawn a StaticMesh component that does NOT cast dynamic shadow.

3) On a less important note, I am also looking to have an object be static and have baked lights, but would like them to be moved during run time on an on-demand basis ( e.g when shot at ). When this happen , i suppose static objects will not take advantage of dynamic lighting I guess? Would this be correct?

avatar image Ben Halliday STAFF Mar 31 '14 at 03:06 PM

Hey Frozenfire,

Your answer lies mostly in your last question. Static mobility is reserved for objects that do not move or otherwise update in any way during gameplay. Static Meshes will have their shadows calculated ahead of time. If you intend for it to move at any point during gameplay, static lighting on a mesh would not work, and that's what dynamic lighting is for.

So to answer your first questions, the mesh you'd like to remain persistent would need to be placed in its position at level load and dynamic lighting would apply its shadow. You can play with what types of shadows the mesh casts or does not cast by creating a Blueprint from your mesh and assigning its lighting properties from the Details > Lighting tab in the mesh component.

There's a basic overview of mobility settings in our documentation here: https://docs.unrealengine.com/latest/INT/Engine/Actors/Mobility/index.html

and some great lighting information here: https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/index.html

Hope that answers your questions!

Ben Halliday

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

Hi @Ben Halliday

Thanks for answering most of the part.

Specifically on 2) , I am not referring to pre-placed components. I'm referring to components that are being spawn during runtime construction script.

This is the script that I'm doing . https://forums.unrealengine.com/showthread.php?1630-VIDEO-Semi-Automated-Procedural-building-system-in-Unreal-Engine-4-0

It generates window on runtime but it always cast shadow and I have not found a way to disable it via blueprint.

more ▼

answered Mar 31 '14 at 04:24 PM

avatar image

Frozenfire
662 61 84 117

(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