Hi all,
I’m fairly new with coding and blueprints so hopefully this will be an easy answer for yall.
I’m trying to create a hockey game and I want to be able to have a tracer and target show up for where you’re aiming (trajectory I suppose).
What I’m trying to accomplish is
-Player holds shoot button then tracer, beam and target become visible and controllable.
-Upon release of the shoot button the puck will launch towards the target
How I’ve set it up so far (for debug purposes)
-BP belonging to the Puck mesh has a custom event called SlapShot
-Slap shot GETS location of a noCollide mesh in my Player blueprint
(Location where the puck should be possessed)
-BP belonging to the Puck mesh then sends a float back to the SlapShot event that dictates how many times the result of the location should be multiplied
-I call for SlapShot in my Player BP as well as spawning the puck mesh.
-Depending on the location of the Target mesh and beam it sends the location back to
my SlapShot event with the result.
I’ve been using AddImpulse and AddForce as well as some other node I can’t recall.
and although the puck DOES launch it is ALWAYS offset. I’ve tried different meshes, static and skeletal, played with the simulate physics.
I’ve tried adding and subtracting from the Y axis to create an offset however when I move my character it continues launching almost directly forward (wherever my player model is facing) instead of towards the target.
I could be missing something super obvious and I’m really hoping someone can point me in the right direction
Character BP :
Biscuit BP (Puck) :
While trying to debug the situation I attached an arrow pointing forward on the puck mesh and everytime it spawned in it was EXACTLY where it needed to be facing, so I imagine it has something to do with my “launch” system that is the problem…
And for the time being I removed my “power up shot” timeline to try an expose the directional issues.
Ultimately I would like there to be a float that dictates how fast the puck should move but for the time being I would like it to stop glitching out after moving my player.
Example Video :
Any guidance would be greatly appreciated <3