Hi guys, I’m trying to make a system that makes a component in my BP_player to follow the mouse direction, but I’m having one problem with it.
The Mouse position and the Component are mirrored. (See pictures)
The photos shows the first Event I made (Everything in one single event (RotateBallPosToMouseDirection))
The other 2 photos show that I separeted in 2 functionalities (TrackMouseDirection and UpdateBallPosition)
Both of them are being called EventTick.
Anyone can help me identify the problem?
EDIT 1.: If I change the math this way (see photo), everything almost works. The only (and big) problem is that now the ball is below the player, not above him. But the ball is following the mouse direction as it should be (See photo)
EDIT 2.: I removed the Clamp (Float) Node and did 2 multiplications on the SINd and COSd.
This made the ball be able to move around the player on a 360° arc and follow the mouse direction.
Now I’ll try to make the ball not clip inside the ground while the player has it.
(Don’t know exactly what solved the problem with the ball following the mouse direction.
This is the components necessary for the code to work.
We added a “Spring Arm” to rotate around the player (Same thing as before, but now working).
I can’t thank him enough.
Suthriel, if you read this. THANK YOU!