Hi everyone,
I've been having a lot of trouble figuring this out, I wanted to see if anyone here has a solution..
I'm NOT advanced at Unreal Engine, so I'm using blueprints, instead of code, and also have been working with Unreal for just about 2 months on my own.
I'm creating a "Sampler" for carpets and floor tiles and such. So you have Top-Down view of a floor plan, and the floor is separated in "areas" of how you can add different materials to the floor (ex. Kitchen, Living Room, Bathroom, etc). The idea is for the user to drag and drop a material (HUD UI button) on top of the Kitchen for example, and the kitchen floor to change to that material. the same for the other areas of the room.
This whole app if for the iPad, although I'm working with mouse and keyboard right now.
So this is what I've tried:
I have also tried:
The Way I figure should be done (Even though I don't know how, or if its even possible) is:
Please Help,
Any help is appreciated,
Thank you in advance!
Best Regards!
I've been having a lot of trouble figuring this out, I wanted to see if anyone here has a solution..
I'm NOT advanced at Unreal Engine, so I'm using blueprints, instead of code, and also have been working with Unreal for just about 2 months on my own.
I'm creating a "Sampler" for carpets and floor tiles and such. So you have Top-Down view of a floor plan, and the floor is separated in "areas" of how you can add different materials to the floor (ex. Kitchen, Living Room, Bathroom, etc). The idea is for the user to drag and drop a material (HUD UI button) on top of the Kitchen for example, and the kitchen floor to change to that material. the same for the other areas of the room.
This whole app if for the iPad, although I'm working with mouse and keyboard right now.
So this is what I've tried:
- Line trace to the mouse position converted to World Space
- Object type to create a "Make Array" where I created a collision object and only the floor geometry is in it (to ignore the rest of the geometry, incase there are tables and chairs or other furniture)
- Break Hit Result the face Index and the Component to a "Get Material From Collision Face Index", Section Index to a Set Material Element Index and the Hit Component to the Target of same Set Material.
I have also tried:
- Creating a Function in the Controller that will give me the Index # of whatever I'm hitting with a Line Trace, and using that function as a trigger for the button to set a material. (Basically that was the idea, but was poorly developed) so I never even got cose to ir, mostly because I'm still having trouble referencing the Mesh as the Target of the Set Material in Widget Blueprints.
The Way I figure should be done (Even though I don't know how, or if its even possible) is:
- Create a Function that will Give you two outputs (Both things needed for the Set Material Node)
- a hit result of (whatever you have under your finger, Screen Space to World Space of something like that) the Face Index, this will give you the 'target' element index of the material you want to change.
- A hit result of the component, the 'target'
- Create a Custom Event Dispatcher to trigger that function (Or Macro) and set the outputs to the Set Material fora each of the materials you have (Material_01, Material_02, etc). This should allow you to click the button and drag, and while dragging, the line trace will give you the target mesh and the element index it has (the one you will change) and when 'released' or 'Dropped' it will trigger the Set Material, Target and Element Index being the return values of the Hit Break Result while dragging.
- Call the Event Dispatcher with the button in the Widget Blueprint.
Please Help,
Any help is appreciated,
Thank you in advance!
Best Regards!
Comment