It can't be this hard to throw a projectile and teleport to it.

I keep watching tutorials but I cant grasp how the hell to make things work.
I have the plan in my mind, I press G it throws a sphere in an arc, like you would throw a rock, then I press it again and I teleport to it. Why is it so hard to make this happen!! I am loosing my mind over these blueprints I keep giving up and trying again when I think of a new solution but it never works.
I understand that I have to make a sphere and give it an initial location that is in front of my first person character, then if i press G it should add an impulse to the sphere and if G is pressed again the character’s location should overlap with the sphere location.
I am getting tired of even trying anymore.

Could look like so:

Using a simple projectile:


How to throw it is up to you, just an example.

3 Likes

EDIT: Everynone beat me to it, here’s mine anyways :stuck_out_tongue:


Start by creating the projectile :

  • Create new blueprint class extending Actor
  • Add a Sphere component, make it the root. This is important because that sphere is gonna handle collision, and an actor’s location is determined by the location of its root component, so you generally always want collision component to be root.
  • Add a Projectile Movement component to give it projectile physics. Tweak its properties as you desire.

Here I defined speed and enabled bounce. I also added 0,1 to Velocity Z to add a bit of a lobbing effect, which is pretty common. You can try with and without and you’ll understand the difference immediately.

In construction script, bind the projectile movement component to the collision component :

image

Now we move on to character BP. Since we are gonna spawn a projectile and teleport to it later on, add a variable to hold a reference to it :

image

Now, when pressing G, I should teleport to the existing projectile (if it exists), or spawn a new projectile in front of me. GetActorEyesViewPoint is generally a good method for getting camera location & rotation in first person. Spawning directly on camera however is troublesome because it’s going to collide with character itself, so you want to offset the spawn position forward a bit. After spawning, assign the new projectile to our variable. After teleporting, destroy the existing projectile (the variable will be automatically cleared).

3 Likes

Oh wow, I didn’t expect an answer to be honest and I got two!! You have no idea how helpful this is mates, I was just venting out my disappointment but this is unexpected. Thank you very much for your suggestions I will try them immediately.

1 Like

It works perfectly!! Since I am using UE5 I have to use the MakeTransform node to spawn the projectile correctly but it works fine!! Thank you good sirs.