Need help refining Projectile

Hey There, I’m trying to refine my projectile and am having a few difficulties. As you can see, there are a few issues with the setup (In BP_Blade_Weapon I rotated my ‘Blade’ for it to sit in the hands socket correctly. I am not sure if this will bite me later or why I had to do this in the first place).

Additionally, The projectile somewhat goes wherever it wants and since this is an FPS I’d like it to shoot directly down the center (Where the crosshair will eventually be).

Lastly, I currently have the blade respawn in the PC’s hands after a delay but I want it to return/recall to the PC rather than respawn (Thor’s hammer vibes). How can I achieve this?

Any help with these would be greatly appreciated! <3

Alright the point is not to shoot it straight but where it should hit… in FPS games the main calculation of the FPS controller is to hit the target… and since u want to just shoot it straight u can animate it to do that… or use physics like in the FPS template with zero gravity on the blade… Using an animation would be best so u can reverse the animation (timeline) for it to return back to your hand… Or a very heavy way to do it would be to draw a ray to ur character from the blade and add force to the blade in that direction… Hope this helps :slight_smile:

1 Like

Thanks! This sounds like it’ll do the trick :smiley: Much appreciated!

Spawn a simple static mesh actor for the attached component. Keep it simple.
The throw would hide the attached actor and spawn the projectile one. Again keep it simple.

Also, get rid of the scene component in the projectile. Projectile movement MOVES the root component.

Proper structure for projectile is:

  • Collision component
    • Static Mesh (No Collision)
  • Projectile Movement

For the return functionality I’d use the Homing function built in to PMC. Set your self (character) as the target.

1 Like

a homing function would be a lot better than an animation…

1 Like

Thanks so much! Your advice is working like a charm. I wanted to follow up to ask about the homing function as I’m unsure of how to attach my First Person Character to the Homing scene component. I also think I’m struggling because my Player can fire infinite blades but I want there to be one that can be refired only after it returns.

Will it work to create a branch + condition that is dependent on the destruction of the spawned actor? (Edit: Figured this out using a rather untidy ‘do once’ statement. Still lost on the homing function tho)



That looks overcomplicated.

Take the SM weapon that’s attached to hand and make that the target component for the homing projectile.

Pass a reference of the character to the projectile vs get all and loop.

Use a Timer instead of delay node.

I’ll whip up a demo as soon as I have a moment.

1 Like

@ItsDumi Working on it.

Regular fires a standard disc.
Alt Fires a returning disc.

Homing is a bit buggy on the return if the player is moving, trying to work out a solution that I’m happy with.

1 Like

Holy cow thats so cool! That’s exactly what I’m going for :smiley: I really appreciate you doing this

Overview
I spawn an Actor class and attach it to the character. This actor has a static mesh disc that’s toggled hidden as projectiles are fired. This class contains all the logic for spawning (firing) disc projectiles.

If you need a video walkthrough to make it make sense, let me know.

Character Class setup
Spawn disc is called on Begin Play.
Use whatever inputs obviously. I’m using what’s available in my demo proj.

BP_Disc (Actor)
This is the primary actor it handles spawning the projectile discs (Standard & Homing)

Disc mesh, No collision
Return Collision, blocks only projectile (this is toggled on/off in code as needed.)

Aim Velocity function
This determines the Shoot at Direction and applies the muzzle velocity to the Aim vector.

Returns: Projectile Aim Velocity and Spawn Location

BP_ProjectileDisc
Standard Projectile setup

BP_HomingDisc
When a disc marked HomingReturn [true] HITS it spawns this actor to return home to the character. This projectile is similar in structure.

Static mesh, No Collision
The Root collision component handles all interactions. It’s also scaled up a bit. This aides in the return functionality.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.