This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi everyone!
I'm a beginner hobbyist game developer. I'm currently working on a basic 2d platformer with multiple moving enemies. While testing, I noticed that the frame rate drops significantly when I have 10 enemies. Right now I bypass it by deactivating enemies when the player character is outside their "load zone" trigger hitbox, but it's still an issue if there are multiple entities near the player.
My suspicion is that I overused boxcasting/raycasting. I use it for ground and wall checks for the player character and every enemy on every frame. Is raycasting/boxcasting too expensive to be used like this? If so, what's a better alternative? I thought of only checking once every number of frame, but it might affect the responsiveness of the platforming controls. I also thought about using trigger colliders around the units but I'm not sure if this would be faster.
What do you guys think?
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Unity2D/com...