Drag back object and release to apply force

So at first I had a problem with clicking to drag an object with a mouse but it got solved at this link Click to drag actor not working correctly - Blueprint - Unreal Engine Forums

I have run into another problem though when I click and drag the object back and release the mouse button it won’t apply force to the object. What I am trying to achieve is an angry birds style of shooting. I asked it in the other question but was told to start up a new question and also was told that some of this would help

"I recommend setting an initial point variable, and an end point variable once touch is released. Then call a new custom event and use those variables. It will make your blueprints MUCH easier to follow and you’ll be glad you did as you progress.

I think you want to use Get Length Vector 3 but I don’t have my engine up in front of me. Then you can add a multiplier onto the result."

The only thing is I am still new and learning blueprints and don’t really know where to start with this. Below is the blueprint I have so far.

Try something like this

I don’t remember if get direction returns 0/1 values. EG: 1, 0, -1 rather than 10, 0, -15. If it only returns 0/1 you’ll want to use the Vector Length node. If it returns digits other than 0/1 you can just multiply the result by a float.

Do I plug in the mouse initial and mouse end into the beginning slots of get direction vector?

So this is what I have right now it looks kind of crazy but it still isn’t

firing the Get direction vector after it multiplies by the force seems to be working as it prints out values like x:2000 and z:2000 for example but it still won’t have the force applied to it.

Ok so a little update! I increased the force to over 2million and it is now appliying the force the only thing now is some of the directions it shoots in is messing up. So for example if I pull the ball straight backwards instead of shooting straight it will shoot straight up into the air.

Yeah, it might have something to do with the fact that your blueprint is a pile of spaghetti.

Here’s something I made that seems to be working fine and is much more organized :stuck_out_tongue:

Also your screenshots are very blurry some reason.

Amazing! It seems to be working perfectly now :smiley: Btw how did you put in the little spits in the blueprint wires to help keep it cleaner? Also how does clamping a vector work?

The splits are done by using “Add Reroute Node” when dragging out your pin.

A vector clamp works by setting a minimum and maximum to the vectors length.

Each axis of the vector will be multiplied by a value which will maintain the vectors direction but keep the length within the specified range in Clamp Vector Size.

Vector lengths increase as the values within vectors do. In your case a longer length would mean a larger launching effect.

You could also clamp each float from the vector and rebuild the vector but I don’t recommend this because it would create weird trajectories.

In [4.13.1] I cannot find;

  • Launch Actor
  • Return Cursor to Screen
  • Return Node

Anyone know the new names for these options?

Cant seem to find these still:
Launch Actor

Return Cursor to Screen

Return Node

Nvm, this is a function which you make yourself on the first picture, that you make pure on the right side after you made it