K
K
killmeplsfast2019-07-03 14:04:39
2D
killmeplsfast, 2019-07-03 14:04:39

How to solve the problem of incorrect spawning?

On the stage, the enemy and the hero, when the hero crosses the "beam" coming out of the enemy's weapon, a laser flies out, until some point it was like that, but after the project was abandoned and opened after some time, instead of spawning the 1st laser, spam of lasers began , I can’t understand why, I didn’t seem to change anything, but it just can’t stop working?
5d1c8b8991d36084320581.jpeg
5d1c8ba86131d720003138.jpeg5d1c8bb1bb760602347197.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-07-03
@MrMureno

I don’t know what was there before, but now according to the code, each cycle of physics (it’s strange why they didn’t do it in Update)
you check if it was hit by a beam.
since there are a couple of tens of cycles per second - it's not surprising that the condition is triggered several times almost in a row))
maybe the timer was arranged differently there before.
or in the project settings fixedDeltaTime for some reason was changed to some rather large value (which, in fact, was not worth doing)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question