Jump to content

Select GameObject in front of a player

Guest Woweur

Recommended Posts

Best way to do that is to use a Searcher struct and apply it to all nearby cells of the player. If mangos doesn't already have such searcher structs already built in GridNotifiers.cpp/h, I believe ScriptDev2 has some that they are using in some of their scripts for just this purpose of finding the closest gameobject/creature from a player. For best examples, you can check out their code on how they do this, just do a search in all SD2 files for "->Visit(". A lot of them (all?) use this idea of a searcher struct to find nearby objects in the cells.

Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use