When I add a static mesh component to a Blueprint, I can set the mobility in the details panel:
But how do I set this for a component that created at “runtime”
I cant find a “set mobility” node or something like that. How is it done?
the normal easy answer:
Create BP from mesh etc.
Spawn BP Actor - Spawn Actor From Class (node) - needs a local transform where it initially starts at
Move Actor - AddActorLocalOffset (node) - use vector to move (usually a break & make vector and move it on the x,y,or z axis)(using a timeline, timer, and if in a hurry or testing event tick (not advisable for finished game)
lots of documentation & tutorials on the different approaches but that’s pretty much it, put simply.
google search & here’s the doc search page: https://docs.unrealengine.com/latest/INT/
*** post more details on what you are trying to achieve if you need more info ***
Edit: let me add this link to eXi’s stream (this is youtube archive) that might help a lot: https://www.youtube.com/watch?v=dhwbiX38VdU
Thread about his stream: https://forums.unrealengine.com/showthread.php?67824-FREE-Live-lessons-in-UE4-Information-and-Recap-Videos
and Zalieth’s : https://forums.unrealengine.com/showthread.php?67104-New-Twitch-Stream-for-Live-Blueprint-Tutorials!
Hmm. Thats exactly what I did in my screenshot, isnt it?
Maybe you misunderstood my problem: I want to change the movability setting of the created mesh from “movable” to “stationary”. (Thez are movable by default)
sorry if I misunderstood, but why set them to movable if you don’t want them to move?
if I understand what you are trying to do, they won’t move after you move them unless you have physics or something cut on, is that what you need? turn physics off?
because once you move it, it should really stay where you put it.
note you can drag the component (Mesh) into the event graph then drag off of it to access what you can actually do with it in a BP
Edit: if you are simply trying to set them to stationary just click stationary in your first screenshot and they won’t ever move unless simulate physics is checked (in same details panel)
it will take care of itself from there.
Just set it as movable, moveable means it can simulate physics or have something done to it. If you turn off simulate physics, it won’t move
I dont. The engine does. When I add a static mesh component via blueprint graphs, the static mesh is movable by default.
The mesh does not have a details panel, because it is created as part of the construction script.
I know, they will only move if I want them to, which I am not. They will never move.
The reason to set them to static is that they can benefit from static lighting.
Yes. The actor mobility. And now to my question: How to set that for a mesh created via blueprints?
don’t mean to drag this out, but pretty sure you can’t and that link is why basically.
you make them into a BP & move them via methods like I posted above or you don’t, the link provides lighting info & reasons.
you can still move them in Level but still just a BP, what you are doing in your construction script is creating the meshes at runtime. back to lighting link, sorry
In the linked page, there is no hint about setting that in Blueprints. The word blueprint is not even mentioned.
Just a sec. I make some more screenshot and explain exactly what im doing…:rolleyes:
this problem is getting into rendering / lighting which i’m not particularly strong at, so just trying to help as much as I can now, KVogler. just so you know
just remarking on what I do know or understand about it
So here is the “big picture”
Making a tiling set of road meshes inclusive curbs where the level artist can simply select from a dropdown list the type of tile he wants and then its set up within the BP.
So I started with an enum, describing the different types of road tiles:
Then I created some meshes for the tile and the different curb/sidewalk shapes.
Then I created a BP based on Actor and put in a ground floor mesh as root. The ground mesh will always be there.
Also I added a variable that hold the tile type.
The construction script now looks as follows:
So, depending of the set tile type, the appropriate meshes get created and positioned inside the functions.
It works like a charm:
But as its indicated by the wireframe coloring, the meshes are “movable”, except for the floor mesh.
For the floor mesh I can set the mobility because I added it to the BP via mouseclicking.
The curb meshes are created by Blueprint execution, thus they are not accessible via the blueprint editor…
Sooooo after all this text: How can I make the curbs to be as static as the ground floor mesh…
wow… looks nice btw, envious
tried making the meshes BPs as well then adding them?
BPs do have limitations after all, hard to find work-a-rounds sometimes.
Thanks… I also made a nice roadsign system… You select the sign zou want and meshes for sign and clamps and materials are fetched from a datatable…
A couple of days ago I finally understood one critical key element behind the BP logic. I really made -click- So Im on quite a high now
I thought about making a little tutorial about it. Im so happy with my new knowledge so that I want to shar with others.
I just need to get a decent headset/mic…
Hmm That actually sounds like it could work. I will test that later. I just hope the BP holding the mesh is not simply becoming movable as well…
sounds good, would like to see that tutorial
I plan to make it like a “prequel of a lets play”. So I will be starting really from scratch. Not like in other tutorial where they use prepared stuff.
So it will be not only a UE4 tutorial, but also a 3DSMax Photoshop, WorldMachine, MudBox/ZBrush and Audition tutorial, as these are the tools I use.
Do you know if I can use the UE4 logo in the video title, etc?
Can really noone help me here?
Its really stopping me from finalizing a lot of things. I just made a procedural Fassade system in blueprint where you can select floor count, etc and the fassade is created.
A little bit like the Fassade tool in UDK (when its finished)
But the problem I have is the same as with the road tile s in the beginning of this thread: They are horribly lit due to their dynamic setting.
One directional light; setting: static
One directional light; setting: stationary
One directional light; setting: dynamic
Even dynamic looks really bad compared to static lighting with truly static meshes (the right wall):
I have so many super fantastic ideas, but it all hangs at this lighting/mobility issue
Any help would be highly appreciated
hi, not sure this applies or will help but shouldn’t the mesh component be attached to a Scene Component
ie: add Scene component then add your mesh component and make sure the scene component is the root
once you do this the mesh can be changed to static in the BP, not sure how this will effect your lighting tho’
but it might help in the long run. worth trying K
Because when they are “static”, lightmass is able to generate static lighting for it. Otherwise I have to live with dynamic shadows and the results observed.
The wall on the right in the last screenshot is made of static meshes (manually assembled) and looks best.
waaaiiiit aaa minite here… Maybe Im just spawning the thing wrong :eek: Could be. :rolleyes:
So here is my little floor creation routine. I simplified the graph a bit:
This is the construction script of the blueprint:
The Base is created directly, then the CreateFloor function loops as required, then the CreateRoof function adds the roof.
The CreateFloor and Create Roof functions look like this:
They both call the PlaceComponent function which finally creates and places the component:
So I guess this the function that needs to be corected.
How does a proper spawning sequence looks like
Thanks for all help
I just feel so stupid. So very stupid. Like I can feel my brain melting in stupidity and oozing out my nose. Please whack me with a frying pan… :o
I was hunting down some further info on this as : https://answers.unrealengine.com/questions/4742/is-there-a-way-of-changing-an-actors-mobility-in-b.html
which was a bit discouraging at first, but then thisone solved it:
I basically had to set the movability to static in the add mesh node… I completely missed the details panel option in this node. thought its a property that i change then on the spawned mesh.
And aftera bit of thinking its logical why: This allows to tweak the setting in a BP to static but only at spawning, not during ticking. So its suitable for the construction script
Now it looks much much better :
Only the vieport does not seem to reflect transforms when the actors are static. in the level they are created at the correct positions.
Thanks again for all the help.
lol np. thought that’s what I said but ya might be like me I get so focused that I develop tunnel vision and can’t even see the light of day.
but happy if I was of any help at all.
but I’m curious though so if you have time, create a new BP (actor) and test this:
add a scene component you’ll find it in the list then add the mesh component, this should allow transforms etc with anything below it.
(in case you want to add several meshes and other components now or later)
then add a mesh component, adding this last should attach it to the scene component that is the root, if not drag it on the scene component (this should make the scene component the root)
(this is where you use the detail panel to add the actual mesh, not the top one - leave the top that refers to the BP (self) alone)
try this and see what you get, not sure how this would work the way you are using it in a construction script but curious to find out
(and don’t forget to make it Static - lol )
all in all, looking better all the time. again good luck n update so we can see how it’s going