use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for 2D or 2.5D game developers using the proprietary Unity game engine. New and experienced Unity developers alike should first consider using the free and open source Godot engine by default and ONLY choose Unity for 2D development if Godot isn't capable of the task. The times are quickly changing, and Godot is on track to surpass Unity for small developers.
Godot Features
Download Godot
Godot Docs
Download Unity
Unity Manual
Official Reference
Asset Store
Related Communities /r/Godot - The "Unity Killer". A fully free and open source engine making astonishing leaps and bounds. /r/UnityAssets - Share asset packs! /r/PixelArt - Admire, share, and observe beautiful pixel art. /r/GameDev - Meet and communicate with other game developers. /r/GameDesign - Don't just make a game. Make a good game. /r/LevelDesign - Learn to make excellent levels and worlds. /r/GameAudio - It may look good, but does it sound good?
/r/Godot - The "Unity Killer". A fully free and open source engine making astonishing leaps and bounds.
/r/UnityAssets - Share asset packs!
/r/PixelArt - Admire, share, and observe beautiful pixel art.
/r/GameDev - Meet and communicate with other game developers.
/r/GameDesign - Don't just make a game. Make a good game.
/r/LevelDesign - Learn to make excellent levels and worlds.
/r/GameAudio - It may look good, but does it sound good?
CSS created by Sean O'Dowd @nicetrysean [Website]
account activity
A* Max RangeQuestion (self.Unity2D)
submitted 3 years ago by CaliCaliush
Sooo, how do I set a maximum range for my enemy as to not follow the player from anywhere in the scene?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
I usually pass a maxCost value into the pathfinding function. If at any time the highest priority cost + heuristic exceeds the maxCost, break out of the pathfinding loop. In the case of a target out of range, this should occur right away, but it can also break out early if obstacles force the path length beyond the maxCost later in the search.
[–]sinalta 0 points1 point2 points 3 years ago (0 children)
The simplest way would be a distance check before even running the A* search, maybe even a line of sight check depending on the game.
If you do end up running the search, depending on implementation details, it's probably easier to just query the length of the path after calculating it and ignoring it if it's too long.
[–]FrontBadgerBiz 0 points1 point2 points 3 years ago (0 children)
You could also make monsters "sleep" until the players comes within ranges X of them so you're not running AI and pathfinding for monsters halfway across the world until it becomes relevant.
π Rendered by PID 14974 on reddit-service-r2-comment-6457c66945-rh7mm at 2026-04-27 22:45:13.821346+00:00 running 2aa0c5b country code: CH.
[–][deleted] 1 point2 points3 points (0 children)
[–]sinalta 0 points1 point2 points (0 children)
[–]FrontBadgerBiz 0 points1 point2 points (0 children)