- Home /
Enemies pop up 2.0 Y roughly when shot.
I have a basic project after a week where I am able to shoot zombies that when shot die, When they're close they attack, all transitions in animations look smooth however..
When I shoot them, they seem to pop up to about chest height for a frame then return to the ground like a flash or flicker. Is this being caused by my collisions from a line render? I'm miffed as to why this is occurring. I will continue to troubleshoot and see what the cause is, but was curious if anyone else has run into this before.
You're on the right track, I think. If you're using TriggerEnter or CollisionEnter and the zombies have RIgidbody components, you might try setting the rigidbody to be kinematic immediately when the death condition is detected. This ought to prevent the jump outright, but it might also break your animations. Give it a go, and an example of your code would certainly help for troubleshooting purposes. It may also be an issue with the death animation. Try preventing the death animation from playing and see if the zombies still jump on death?
I have tagged the problem down to my capsule collider being used as a hitbox on the zombies. When hit it pops them off the ground by the radius of the collider. I'm not sure as to how to get around this yet, but that seems to be what is causing the problem.
Well, I don't know really. Honestly there is no rigid body and the tigger still pops it up. With a rigidbody it does the same. The death animation works perfectly fine. Its every hit that's causing it. I know for certain that its the capsule collider's width causing the issue. If I blow it up to obscene proportions like 10.0 the zombie literally pops right towards me as I shoot it. Like it phases in. God I'm loving this stuff. So much fun in the past week. I'd post my code but honestly I've got about four scripts working in unisen so I wouldn't know where to begin. I know for certain that its the collider thats causing it.
You're talking about trigger, but the pooping can only we caused by a collider. Why not making it a trigger?
I have the collider as a trigger checkbox checked, not sure if thats what you mean. Again I'm pretty new. is there a trigger component specifically? And I'm pretty sure I've done it as both, still does it regardless. I'm gonna try making my script handle on a child of the object tonight, if possible.
Answer by Vilhien · Sep 14, 2017 at 11:13 PM
Ok I figured out what was causing it. I have this part of my script now commented out and it stopped the action.
hitParticles.transform.position = hitPoint;
It was not a collider after all, but a point being allocated to the collider calling a particle system to spurt blood.. I don't know why it would have popped the enemy like that.. But for now I've figured out the popping cause and I'll look into it more. Thanks guys!
Above was fixed by attaching said particle system to an empty game object housing said particle emitter.. BUYA$$anonymous$$A
Your answer
Follow this Question
Related Questions
Random Number generation 2 Answers
Extension of editor and custom GUI 0 Answers
Unity card game issues 0 Answers
Sprite Match Mechanic 0 Answers
Generating cars in a parking garage? 1 Answer