Hi all, i’m new to blueprints and just kind of throwing youtube tutorials together.
im wondering if anyone is able to help me with this?
i’m trying to make it so that when the player clicks on the blueprint which ive placed in the world (player clicks on a tree) the player will move to the location where clicked and then will execute the custom event.
this is in my player controller.
i’ve tried setting up box collisions in the tree blueprint and player blueprint and casted to the custom event interactbpskills but the player still gets exp from a distance and not only when the player is net to the tree.
any help is appreciated 
AI MoveTo command probably not working since you’re using player controller not ai controller. Try using Simple Moveto instead?
Or, depending on what type of game you’re making you could make the player pawn use an AI controller, and have the player controller possess an invisible spectator actor, and just sends commands to the pawn. This could work well for a sim game of some sort, but not so much if there’s fast action.
This is my movement from the example top down template.
How would I go about making it only execute the custom event interactBPSkills when the player is next to the area i want him to be?
ive tried setting up a box overlap but im missing something in the way the code executes its sequence.
Ah, topdown controller right? Well, first edit the GetLocationUnderCursor function to return an actor. Inside that func there’s a linetrace, break its results if the hit pin isn’t already split, check if hit actor is valid, and if so drag that onto return node. If not valid, only return hit location. Next add an actor variable to controller called ClickedActor or some such. Then in the click input event, from started (or triggered if you want constant update during mouse drag) set the new ClickedActor var from the updated GetLocationUnderCursor function.
Next make a function that first checks if ClickedActor is valid, then Get Distance To clicked actor from your controlled pawn (which should already be a var in controller), branch off a less than node using your desired range, and if true call interact funct or whatever. If false do nothing (or have pawn say “it’s too far away” with a sound or just print string).
Call this new function before the move to call from the completed/cancelled pins on input event.
Worst case here is you might have to click something twice if you click it from far away and release mouse before pawn gets there. I don’t think there’s a nonsync moveto which works on players by default. AI moves have a pin for finished that fires after they get there, but not player controller AFAIK.
In the new function which checks the distance, you could also find out what you’re clicking (either by getting ClickedActor’s class, or checking it for tags/interfaces) then do something other than interact. Like if its class or tag = enemy or something, you could call an attack function. Or if it’s a tree, play a lumberjack anim.
I was able to fix it by doing this.
And on the enhanced input i connected it from follow to set bIsMovingToTarget which is true and then to simple move to location, with the goal to get location under cursor.
and it seems to be doing what i want it to.
Probably better to call he interatcion from a begin overlap on the resource actor or mouse click finished as described above. Checking distance in tick like that means it will always be checking distance to click location every frame. And if you’re not storing a ref to the interactable on click, the hit result under mouse as object node might fail if player moves mouse over something else while pawn is still waddling over to the moveto loc.