When I run it, I get the error in the log as shown. It is suppose to create a triangle with the vertices specified in triangle vertices array. Is there documentation on the CustomMeshComponent viariable?
What am I doing wrong here, and is there anything I can do to get rid of the error, and make the triangle spawn?
(Or even documentation about this specific variable type)
You trying to call function on nothingness as CustomMesh1 varable is not set (its None). You can fix that by setting varable beforehand or checking if varable is set.
Do you mind helping me a bit more, it still seems to not work, what nodes would I need to add for the triangle at (0,0,0)(100,0,100)and(0,100,100) to spawn?
You need custom mesh to spawn in to world right? So spawn it and set to variable, or else you already got it in level then you can set it as varable defau.t
I was just able to do this.
I had to do it not in the construction script, but in the event graph after “Event Beginplay”
You have to use “Add Custom Mesh Component”, pass an Actor to that and store the result into a variable, which you can then reuse whenever you want.
I recommend also spawning a new Actor beforehand, because the placement of that custom mesh depends on the position of the actor you passed it. (I made trails for bullets and added the Mesh to the bullet, so the mesh basically moved with the bullet instead of staying at the same place in the world.) If you want the mesh to move with your actor, keep the target at “this”.