Hi, im kinda new in UE4 and I need to do something that may be simple for you but hell for me… In my game prototype, I have severals ball that spawn and I want to create a function that when I press the key E (or any key in fact its doesnt really matter for now) the ball will ‘fly’ midair to my character and follow him, like hes holding it but withouth the animation (that’ll come later) but i have no idea how to do it… thanks very much. Note: I Need to do my function in MainGameMode if it can change anything
I can forgot the ‘fly in midair’ i just want the ball to follow me when im near to it and press a key and i still have trouble on how to figure it out ;s
You can set a key binding action for “E” called “StartFlying” (or whatever). Then bind the “StartFlying” action to a Timer, which calls a new function “FlyToPlayer”. In “FlyToPlayer” you can use “Find Look at Rotation” to take the ball position and the player position, and then use this to move the ball. To actually move the ball, you can use the function “Set Actor Location” to add a delta value toward the player (use “Get Forward Vector” on the result of the balls rotator). You may need to scale this value to get the right motion. Then make sure you clear the timer at the end. While there are probably 15 different ways to do this, maybe this will give you some ideas.
First of all thank you! unfortunatly i’m not sure i can do all that, for now in my event graph I have a ‘’ E node that bind to my ‘PickUp’ function, but for the rest im kinda lost here what i started using what you said
and nothing happens ;s do you have an idea? (Urbas is the name of the ball) or maybe im doing it wrong, im facing a ball with my 3rd person character and nothing happens when i press F
Thank you, its work, i still need to look at some thing but overall my main task is done thanks! (likea way that the ball doesnt leave my character!) thanks very very munch! <3