Ok bare with me while I try to explain what I’m trying to achieve.
I have a player and a soccer ball. I want to create a “sticky ball” situation where the ball, once under the control of the player, will move in the same direction of the player while being nudged forward a few feet but never leaves the player’s control influence.
I have it set up so when the player is facing the ball and is within a short distance of it he then has it under control. I have placed a collision box by the players’ feet that nudges the ball forwards and have set the linear damping so that it only moves a short distance.
I’m stuck on how to make the ball rotate in the same direction as the player. Also; the ball sometimes comes off at a funny angle when it hits the collision box.
Then, we can always cast to character, get its forward vector and set direction? maybe u can put a variable check in tick of ball actor as to when player has control, set the variable to true, and from then on in tick, set direction of ball using character’s forward vector and this u can get by casting (like u will cast to character in begin play of ball so that we will have reference) and on tick, u give the direction from character ref variable to set setting the direction of ball in tick
I do already have a isControlled Variable on the ball as I use this to modify the linear dampening. However; there is no Set Direction node on the ball.
i think first we have to focus on player movement as currently it rotates totally either to left or right as per blending setup … but in football games, we often seen players won’t move like this, its like a 8 way directional movement maybe?
Well yeh lol
I didn’t think it would be so difficult to make the ball go in the same direction as the characters’ forward vector while keeping the simulated physics effect. I just need the character to nudge the ball forward with each stride while retaining control.
Update:
So I’m managed to accomplish the nudging the ball forward a bit mechanic. I had to disable simulate physics and make my own movement and friction algorithm:
But I still don’t know how to keep the ball in front of the player when he turns.
I really just thought that using the player characters’ forward vector would be enough?