OK. So when I play my game a projectile will sometimes hoist me off the ground and let me float into space. I have looked through all the settings and can not come up with a reason for this. It only seems to happen when my character is stationary. Has anyone else experienced anything like this? If so how did you overcome this difficulty?
What exactly do you mean that the projectile will hoist you off the ground? Where are you aiming when this happens? Could you post a screenshot or video of what you’re seeing to help explain what is happening?
Is that effect set up in a blueprint or as a particle system? If it is a blueprint you may need to check how the collision is set and make sure it is set to overlap with rather than block the pawn.
Its a blueprint. If I change the collision to overlap it just passes through the character. This is because Generate Overlap Events is turned off. I am using a collision box to trigger the firing of the projectile. I have turned it off so that the projectile doesn’t trigger onComponentEndOverlap when it passes outside of the collission box. Is there a work around?
The projectile just aims at the character. The Cube you can see in the photo is spawning projectiles and the conditions for the spawn of projectiles is that the character is within the bounds of the collision box, the projectile has not been spawned for at least 2 seconds and that there is a traceable line between the cube and the character. So therefore the onComponentEndOverlap is just turning off a boolean value that gets tested before anything fires.
For clarification, the projectile (which I am assuming is the fire?) is supposed to be damage caused by the enemy? If you are trying to have the projectile affect the player without the player being able to stand on it as in your image, you should be able to set the collision type to overlap with overlap events turned on. The projectile will pass through the character but still trigger your EndOverlap event to reset your bool value.
If I am not understanding the purpose of your projectile correctly let me know what it is supposed to do when it interacts with the player.
Yes. The projectile is the basic BP_Fire. The projectile does damage to the enemy but the only thing indicaating that currently is a print string saying how much damage has been done. That is correct. I don’t want the player to be able to stand on the projectile. Everything works fine when the character is in motion, however, as I stated earlier, when the character is stationary the projectile tends to take the character for a bit of a ride. I dont want the projectile to trigger the EndOverlap. I only want the character to trigger the EndOverlap as he passes through the level. Is this a bug with OnComponentHit? I thought that was the proper way to do things. If it comes down to it I will get rid of the collision box and replace it with a vector length function to estimate the distance from the cube to the character but I dont want to do this unless it is absolutely necessary…
Is the projectile being spawned by the character or by the enemy? Also, where is the projectile being spawned in relation to the actor that is spawning it? At what point are you using OnComponentHit? OnComponentHit will only trigger in the frame where two objects collide. This means that as long as they continue to push against each other (or the player is running up against the object) it will trigger, but if the character is stationary (say jumps on top of the object) then it will only trigger when the player lands and not trigger again until there is an update between the two objects.
The projectile is being spawned by the enemy. The projectile is being spawned from the center of the cube (will eventually be a robot or something) OnComponentHit is firing from the projectile blueprint. You are correct! The projectile gets destroyed if i jump and land on it. Is there a workaround for this or should I start using OverlapAll?
Setting the projectiles Collision Presets in the Details panel to DefaultProjectile will allow you to use an Overlap Event to destroy the actor when it comes in contact with the player pawn, even if the player is not moving.