Whoa, I had no idea that changes in the constructor propagated in the editor before run time. How did a 50+ hour unreal course forget to mention this. Awesome video as always Casey!
@kv71645 жыл бұрын
They way i understand construction scripts is that its the actual spawn / construction of an object based on that class, like a Weapon class could have very different weapons spawned based on the variables that are given to the construction script.
@ue4withcasey3915 жыл бұрын
In reality the construction script is just a tool. It has no defined purpose and we can use it for whatever we need. docs.unrealengine.com/portals/0/images/Programming/UnrealArchitecture/Actors/ActorLifecycle/ActorLifeCycle1.png With this image, you can see that the construction script and begin play fill the same need of happening before tick and any gameplay interaction. However, construction script runs before component initialization. So if you aren't using the construction script to manipulate components, you are better off putting your code on begin play to manipulate variables.
@MiniGameStudio5 жыл бұрын
Thank you. This helped me alot to understand the construction scripts usage.
@zest2heed2 жыл бұрын
Thanks , very useful tutorial, How to add a assembly components/parts to a instance?
@R-SXX2 жыл бұрын
I wonder if you could use the CS for stuff like vehicle customization? If I have 3 different rims, could I theoretically use the CS to change the bone of a skeletal mesh?
@AshishBorakhadikar10036 жыл бұрын
Whoa that's some really good info there. Sad to see less Subscriber for such a great channel. You are doing Good work Casey. I'm learning a lot about blueprints and construction script all thanks to you.
@PardCode6 жыл бұрын
Really good job, mate! As always!
@morrices4 ай бұрын
Thanks for the video. Amazing way to present it! =D
@louisec64313 жыл бұрын
Thank you Casey, your tutorial is very clear as I can easily catch up!
@Slouworker5 жыл бұрын
How would you make it so that the fence mesh would also stretch up to a certain point before creating another piece?
@ue4withcasey3915 жыл бұрын
If you are doing a bunch with repeatable meshes, especially ones that can potentially curve, I would recommend looking into spline meshes. If I find some time I can make a video on that possibly today or tomorrow
@kellykryspin3 жыл бұрын
is there a way to make instance static meshes that i can move around? Like if I wanted to place a bunch of the same boxes around in a room but wanted them to be instances???
@nightwalkerj4 жыл бұрын
Thanks for the tutorial but my stats doesnt list the static mesh calls. Only the mesh draw calls as a whole. How do you see the static mesh/ individual mesh draw calls?
@Paul-hw7kc4 жыл бұрын
How would you use this to create procedural foliage at run time?
@ty_teynium5 жыл бұрын
There should be a tool in window tab or edit tab called CPU Profiler. It shows the stats of the engine's performance on your system so measures how much it's affected. The memory increases. I once followed someone tutorial for buildings and it looks nice but the memory just for one floor was up to 500mb so adding just two or three floors would be 2 to 3 gigs. Now that's just one building though, so if I wanted to make a city with you know multiple buildings, well my computer would jump off a cliff. My point is the Profiler allows you to see how costly on performance this technique is.
@ue4withcasey3915 жыл бұрын
I don't believe the construction script would save what it is doing in memory. Aka there wouldn't be much of a difference in the end result between placing assets and spawning them at run time. That sounds like a separate issue is happening. However, I do agree that building an entire level from construction script isn't smart. However, there are very clear applications of it that can save us time from repeating the same action over and over when building levels.
@TheSwanDragons2 жыл бұрын
Thank you! This was so much better than just creating copies of a static mesh object ^.^
@adamodimattia3 жыл бұрын
But can you move them once they are instanced?
@TheAxebeard6 жыл бұрын
I'm starting over on an old game project I abandoned which involved a procedurally generated city/world. I see how using ISM would be great for roads (wish I knew that before), but I suppose it could also be used to spawn a row of buildings, and mix and match the individual meshes. Gonna have to mess with this soon :D
@ue4withcasey3916 жыл бұрын
Yes it definitely can be. There are drawbacks to ISM though. They behave as if they are all the same mesh in a lot of ways. That means if you can see one of the instances on your screen (one piece of road or building) then your GPU is actually going to draw every instance as if they were all on your screen. So you have to use the ISM with a purpose. This same method can be used to spawn meshes without instancing, however.
@TheAxebeard6 жыл бұрын
@@ue4withcasey391 I'm not sure if this method would be best for this, but I'm currently using the Construction Script to procedurally generate map content. The only problem is, it takes forever when the game starts for the stuff to generate. Do you know how I'd be able to randomize the content in the editor, but then lock it into place so it's the same in-game?
@ue4withcasey3916 жыл бұрын
I would have to do a bunch of testing, but you may be able to use "blutility" or run in editor events to do spawning. In theory (I'm not sure if it would work), but I would probably use construction script to randomly generate things and use seeding to be able to recreate the randomness, and then save in arrays all the objects I'm spawning and where. Then I would take that data and throw it into the run in editor events to do the permanent spawning and remove the construction script. I'm guessing there's a few blocks by UE4 in that theory, but I'm guessing with some manipulation in C++ I could get around it. But this is only one of several solutions for the hitch on load. Other answers could be that spawning the entire city at start is a mistake. You may only need to spawn sections as you go. Almost like level instancing your city into pieces. Or maybe moving the construction over to c++ if that makes it more efficient. Probably doing research on the converting from construction script to permanence would yield some kind of answer that someone has used. Maybe someone has made a plugin for this.
@jimbotht10914 жыл бұрын
thank for your video, it's possible to have multiple texture for a mesh instance (sorry for my english google traduction)
@EyefyourGf3 жыл бұрын
You are awesome,just know that!
@bruceslasher63743 жыл бұрын
Thanks so much Bro
@prashantshukla68145 жыл бұрын
Great tutorial really liked it, except one thing.............ummmmmm....i can't remember :D....It was awesome
@Restart-Gaming3 жыл бұрын
Great but only works on very flat surface this setup will not work on bumpy or mountain terrain