Hi, I would like to know if its possible to make a “Building System” in blueprint. For example if i’m making a survival game and if i want to make lets say a raft or something, I’ll need to collect 5 Logs and put them in a certain spot and once all 5 are placed there the full raft spawn for me to use. If anyone knows if this is possible please tell me and also explain a bit on it
Ok thanks for the reply I forgot to mention 1 thing. I would like to Outline where items need to be placed so players know where to add their materials would something like that be in cascade?
Something like this >
I’m kind of new to blueprint so bare with me. By Spawn Actor do you mean “SpawnActor” “SpawnActor StaticMeshActor?”
and there are like 5 line traces im not sure which one to use. Also is this stuff in the Mycontroller Blueprint or somewhere else?
For the outline, make a material. Make it transparent. Take a look at the unreal engine tutorials by Zak Parrish, they are on youtube.
Change the material to the real material once you are building.
As for which line trace. Try it out. Enable debug on the line trace to see where/if it hits… it’s red until it hits. Then turns green.
Look through my answers on my profile, I helped out a guy doing line traces a while back, dig up that thread, I think there were examples in that.
As for which spawn actor to use… it depends. Spawn actor allows you to spawn a Blueprint actor… so if you make a moving windmill you can interact with, use Spawn actor. If you just want a dumb dead object build, no interaction, use the other thing.
And a word of advice, look through the video tutorials, don’t just watch them, do them. It will take a couple of hours, but you learn so much.
It looks like that’s a picture of The Forest, in which case for a system like that you’re most likely going to need a separate blueprint (probably based on Actor) for each buildable object in the game to keep track of how many materials you need and how many you’ve currently added, that’s what you’d be spawning with SpawnActor.
If you wanted the full ‘The Forest’ effect with logs being visually added as you add materials you’d need to make each log a separate mesh and then add them (or change their material) as you add materials to it, it could be a bit tricky and something you could add after you’re a bit more confident with blueprints and you have a basic system in place. You could also use that blueprint for any interaction with it you might have once it’s been built, like lighting a fire for example.
As has said, if you haven’t gone through the video tutorials it would definitely be a good idea, they’re packed with great information relevant to this sort of thing, and you’re most likely going to need to know your way around a Blueprint Interface for a system like this (I have a system similar to that and it’s very dependent on Interfaces).
Ok i got Transparent material working and im able to spawn it. But can someone tell me how to make it spawn where my cursor is and allow it to follow the mouse until left click is pressed?
Basically you’d do a line trace from your cursor (probably on a key press), spawn the actor at the hit location of the line trace, save the actor you spawned into an actor variable, do a line trace every tick to get the new cursor position, update the position of your building with the new cursor position and finally when you left click you’d stop updating the position, stop doing line traces and remove it from the variable you assigned earlier.
I’m sorry but which line trace do i use, there are like 8 of them and when i try to compile it gives a error “Default value” for ObjectTypes is invalid: “” is not a valid enumerant of '<EObjectTypeQuery>"
Thanks, that helps alot! But do you know of any way to snap the spawned actor to the ground so they cannot be spawned in the air or halfway through the floor?
Make sure all your meshes have their bottom at 0… uhm, hard to explain.
When you make your mesh in a 3D program, you place it in 3D space. So you have to keep the bottom of your art work at 0 on the Z axis. If you have the bottom of your art in say -100, it is 100 units below 0.
Take a look at the “material sphere” mesh in the standard assets. it is placed with the bottom below 0.
Then take a look at the bush or chair. They have their bottom at 0.
as for putting them on the ground.
do 2 line traces. one from your camera 250units out, (what you’re probably doing right now), and then a line trace straight down(just maintain X and Y from first line, -1000000 on Z). Where this trace hits you place it. then you have a point a set distance away, and straight down to the ground.
Ok, I tried what you said but im pretty sure i did it wrong because i got a error…Also im not sure what you ment about using a boolean to track the tracer can you explain more or send me to a tutorial or something?
I’m sorry man. We’re getting down to a very basic level now. And I don’t really feel like making the game for you
I don’t mean to be rude or anything, it’s just… you’re trying too much too soon. You need to get a basic understanding before trying to make “The Forest 2”.
I’m not really a teacher, but I can point you to a place where you can learn basic and advanced stuff about Blueprint.
These are the basic Blueprint videos. There are more advanced videos on the channel as well.
I suggest you go through most of them. You’ll learn so much.
I know this “sets you back” since you’re not working on what you really want, but it seems like you’re trying to build a house, but you can’t use a hammer.
Sorry if I come of rude, it’s in your best interest, learn to walk before you run.