Remove item when Jumpscare triggers

I’m using UE 4.27.2

I’m trying to fix an issue where if my player get’s jumpscared, and if the player is currently holding an item, the item drops so the item won’t get in the way of the jumpscare.

Basically I want to make it so where if you get jumpscared (killed), then you drop the gas can so the jumpscare animation can trigger without the gas can in the way.

how is the item “being held”
is it attached to the actor, is it fused to the actor?
do you maintain a link to the object in question?

what is your JumpScare is it a AnimMontage, PlayMontage, or a Sequencer?

what do you mean by “Remove” do you mean:

  • it just disappears from view, but the item will come back later?
  • the item falls to the floor?
  • the item goes away entirely?

the first option you can just turn off the items visibility, and then turn it back on when the “jumpscare” is over (if this is animation driven then you can attach the change to visibility on the mesh of the SceneComponent that is your items to false out of a PlayMontage->Default_Exec_Pin, then out of the PlayMontage->OnCompleted set the visibility to true.

for the second option that mostly depends on how it is “being held” for fuses you need to un-fuse, for Attach you can just detach (be sure to give it physics), for component of that is a also a detach.

Hey Gardian

Thank you for the help but I actually found a fix for my issue.

I wanted the jumpscare designed so if the player is holding the gas can when they get jumpscared, the gas can disappears so it’s not in the way of the jumpscare.

I fixed this by adding a destroy actor node and assigned the class of that to the gas can the player will be holding, then after that I added a destroy actor node before the play animation node.

Just an easy fix so that whether or not the player is holding the gas can, when the jumpscare is triggered, the gas can is gone.

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