I tried use “Invoke” to make it, but it will repeat shooting every frame. Not every fixed second.
I wants to make it shoot in every 0.5 second. So how can I realize it?
1 Answer
1Loop through a couroutine, in the contents have it:
- Instantiate your bullet prefab
- Add force to shoot it away
yield return
new WaitForSeconds(0,5f);
- Repeat
How you loop it is up to you, depends on how you want it to shoot and from where it will shoot
Can you show me how to write the program in no.3? I have never use "yield" and "waitForSeconds" before. and thank you for your fast replay.
– minghau06I don't think it has to do with the player settings. I would rather assume that you have some code that only executes when the player is in the middle street and that uses a badly designed algorithm. Alternatively, it could be that in the middle lane, some code starts doing recursive stuf. If it's not that, there are millions of possible reasons, hence the need for the profiler. Do you get any errors while emulating it in the editor?
– chillersanim
Thank you, I'll take a look into it, see if I can figure it out! btw do you think it could have anything to do with any parameter of the optimization or configuration tab? ( see picture )[79613-unityask.jpg|79613]
– GilArnau