Yes but to what is connected the FinaliseDrag? How the engine knows that I’m no longer dragging?
You call it yourself when you finalise drag - not sure how you want it to work.
- mouse button going up can be the trigger
- perhaps there is a slot / special place trace detects - that could be the trigger, too
- or maybe the chair can have overlapping collision and hit another collision volume, this could terminate the drag and set the proper collision
- you could evoke it when the drag gets
Cancelled
- you could add a reference to the spawned actor to the drag operation as payload and have
onDrop
set the collision, like in the example above:
The drag operation knows which actor it is dragging, so it could:
Thanks for the explanation but I can’t get it to work, my problem being that I need the object to have a collision since after the player needs to be able to move the actor in the scene like this:
I could stay on the current functioning as on the video with the yellow armchair, but I find it more “complete” to drag the object directly and not only its texture
I tried to call it On drag cancelled but I have no return…
If you’re using a custom drag and drop operation, you can do it there:
Since we’re not dropping on a widget, and there’s no return confirming successful completion, this cancellation will trigger inside the operation blueprint.
If you’re going to use this method for a variety of classes (assuming there will be more than just chairs), you will also need to look into either inheritance and / or interface communication. Casting is not sustainable. But that’s for later.
Or use a channel for tracing, then you no longer need to worry about enabling / disabling collision. Both would work but require a slightly different approach.
Could I just ask what custom channel for tracing you would recommend to do such a thing ?
There’s nothing to recommend. You add a new one and give it a name. The chair ignores it, the floor does not. Use it as you trace.
Finally! Thank you for the 50th time.
There is another way of having a line tracer work as usual with the “On Dragged Cancelled” event. Thanks to “THE IMAGENEERS” on YouTube for making a video about this (link).
Here is the blueprint for spawning as example: