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
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.
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)
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_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.