Hi Guys, I have a small Spline road Blueprint that I have made a construction script so that I can create simple roads in my game, but now I want to make some intersections that are basically using two separate instances of the same Road blueprint I created, so i have lined them up correctly, but If I want to modify the mesh that it’s using for that section of the spline in the Editor, it won’t let me, is there anyway that I can modify the selected spline point instance of the static mesh?
Can you not just make the mesh visible ( and changeable ) in editor?
PS: You can have a different mesh at each point, but you need to modify your construction script to pull the meshes from an array or small selection of meshes to do that.
Yes, that’s exactly what I want to do, but I have found no way to change the mesh of a selected Spline point, I’m able to set the meshes during construction without any problems, but I can’t change them once I have selected a spline point in the editor, do you have any idea on how to do that?
Here is the BP I have done:
And inside of the Create Road Macro:
Everything else is the same, but for different parts of the road.
So I just change my construct to use an array like this:
Naturally, the crucial point is:
The whole constructor is:
So basically when you add the mesh component, you also set the mesh. How you do that is up to you. I have an array which just uses the spline point index to read from the array, which is a bit nuts actually. But you might have only 3 meshes, one for the start, one for all middle points, and one for the end, for instance.
You just need to plop the ‘set mesh’ node into your algorithm right after you create it.
Yeah, that I understand and I’m already doing that so that I can give the scene some variations for the road, but the issue is that I can’t change them once I have selected a spline point in the editor, do you have any idea on how to do that?
In my picture above:
I just change the mesh on the right, and the mesh in the spline in the viewport changes.
If that doesn’t happen for you, it must be a bug in your contruction script.
What happens? Can you change the mesh in the details, but nothing happens in the viewport?
A couple of observations on your code:
- This part is redundant:
because the loop already deals with that.
- I see you’re setting the road meshes by randomly selecting from an array. You will not be able to replace them in the viewport in the case, because the mesh had already been read from the array. Any manipulation will just cause the script to pull another random mesh.
If you want to be able to replace meshes that have previously been randomly pulled from an array, you’ll need to populate a second array during the contruction script, so it knows what mesh is at each point. Bit of a mare I think.
The other problem with that, is that when you re-open the level, it will have changed again. Only way around that is to put the finished result in a savegame or something.
If you want to be able to change meshes manually, you can’t selected them randomly, I think.
True, I will set it to spline points - 1, and rewarding the other point it would combine both techniques since I could still have certain control regarding some spline point mesh and still have some random meshes around does points that are static.
Ok, so what if I create a array of numbers that correspond to a Spline point and when it has to read that spline point I check if it’s in that array and if it is I can simply read the intersection mesh instead of a random mesh so it will always construct a specific mesh in certain points and it won’t put in a random mesh.
Also, that point is just so it won’t populate the last spline point at all.
That’s the same as just reading from an array of meshes, which is what I outlined above. Then you can change the mesh.
If you want to avoid the last point, just make the loop go to spline points -1