I am currently following a tutorial, so I know this should work but I am running into the following problem.
I have a cube that when clicked and dragged on should draw a line along the mouse location. Everything works perfectly except that the texture is always drawn in the same exact location.
This is where everything goes wrong.
Here is the link to the video I was watching: Unreal Engine 4 - Blueprint Texture Painting - YouTube
Are you intentionally using a parameter collection there?
If not, drag off from paint mat and type Set Scalar parameter value, then enter the proper names for the parameter.
edit: if you do want to use the collection, you will have to set that in the node, and choose the correct parameter. Right now you aren’t changing any parameters.
Can you post a screenshot of Cube’s event graph and construction script?
That all looks right. I presume your Draw Material isn’t using collection parameters? They should look like this:
Could you go to where you are doing the LineTraceByChannel, and where it says Draw Debug Type on the node, change that to For One Frame, when you try draw you should see a red dot appear where the drawing should be happening, if you don’t see this then the trace isn’t set up right.
edit: also check that the default values aren’t too low on those variables, strength 1, strength .1 or so. In Cube blueprint.
That’s right. So the only other issue it could be that I can think of must be in the trace in your pawn, check is the trace actually hitting the right location. And that you have Trace Complex checked on the LineTrace node too.
Thanks for that I was able to get them connected right; but now nothing draws on the cube.
edit: how do I set up the collection node part?
Isn’t this how it is supposed to be?
Here is my character trace blueprint:
And I am seeing that the hit location is coming through, although I have no idea how to know if the coordinates are hitting in the right spot.
edit: for example the middle of the cube is (0.5,0.5,0) and when clicking on close to the middle of the cube I get (55,-217,263)
Okay I found out why it wasn’t drawing but it still draws in the center.
(I accidentally had 2 different variables use the same name, ops -_-)
The numbers make sense now but it still draws in the center…
edit: never mind it is working! woo! thanks for you help good sir I could have never done it without you!
I got it working, I refreshed the project and it is working now, as I said thanks for the help!
Sorry, I didn’t notice this earlier ha, in Cube, on your EventPointDamage, it should use Shot From Direction, not Hit Location.
Strange. I’ve got this set up and working in an empty project, do you want me to upload it for you to look at? Or you can upload yours and I’ll see if I can find what is wrong in it.