CU Enhanced Target
Notes

Notes

Credits & Attribution

CU Enhanced Target is based on ox_target (opens in a new tab) by Community Ox (opens in a new tab).

We extend our gratitude to the Community Ox team for their excellent work on the ox_target foundation.

Licensing

This resource includes:

  • ox_target base - Licensed under GPL-3.0 (see LICENSE)
  • Proprietary enhancements - See LICENSE.PROPRIETARY for details

What's Proprietary?

The following enhancements are proprietary:

  • Additional UI themes beyond ox_target's defaults
  • Target hint system and tooltip features
  • Custom configuration extensions
  • Branding and visual customizations

What's Open Source?

The core ox_target functionality remains under GPL-3.0:

  • All base targeting functions
  • Zone creation and management
  • Entity targeting system
  • Framework integrations
  • Core API

Upstream Project

Reporting Issues

For ox_target Related Issues

If you encounter issues with core targeting functionality:

  1. Check ox_target documentation (opens in a new tab)
  2. Search ox_target issues (opens in a new tab)
  3. Report to Community Ox if it's an upstream bug

For CU Enhanced Target Issues

For issues specific to CU Enhanced Target enhancements (themes, hints, etc.):

  1. Contact CodeUniverse support
  2. Check this documentation
  3. Review your configuration

Performance Considerations

Optimization Tips

  1. Limit global options - Each global option is checked on every entity
  2. Use specific bones - Bone targeting is more precise than entity-wide
  3. Set appropriate distances - Larger distances increase processing
  4. Optimize canInteract - Avoid expensive operations in this function
  5. Disable debug mode - Always disable in production

Benchmarks

Based on ox_target performance:

  • Entity checks: < 0.01ms per frame
  • Zone checks: < 0.02ms per frame
  • Raycast: < 0.05ms per frame

CU Enhanced Target maintains similar performance while adding:

  • Theme system: negligible impact
  • Target hints: ~0.01ms when enabled

Best Practices

Resource Naming

  • Use ox_target name for maximum compatibility
  • Use qb-target for QBCore servers
  • Use cu_enchanced_target for new projects

Code Organization

-- Group related options together
local atmOptions = {
  {
    name = 'atm_withdraw',
    label = 'Withdraw',
    icon = 'fa-solid fa-money-bill',
    event = 'bank:withdraw'
  },
  {
    name = 'atm_deposit',
    label = 'Deposit',
    icon = 'fa-solid fa-piggy-bank',
    event = 'bank:deposit'
  }
}
 
exports.cu_enchanced_target:addModel('prop_atm_01', atmOptions)

Cleanup

Always clean up targets when resources stop:

AddEventHandler('onResourceStop', function(resourceName)
  if GetCurrentResourceName() ~= resourceName then return end
  
  -- Remove all zones
  exports.cu_enchanced_target:removeZone('my_zone_1')
  exports.cu_enchanced_target:removeZone('my_zone_2')
  
  -- Remove model options
  exports.cu_enchanced_target:removeModel('prop_atm_01', 'my_option')
end)

Version Compatibility

ox_lib Version

Requires ox_lib v3.0.0 or higher

Framework Versions

  • ox_core: Any recent version
  • ESX: 1.2+ or Legacy (1.8+)
  • QBCore: Latest recommended
  • QBox: Latest recommended

Advanced Features

Custom Sprites

You can customize zone sprites via convars:

setr ox_target:customZoneSprite 1
setr ox_target:drawSprite 24  # Sprite dictionary ID

Debug Visualization

Enable comprehensive debug mode:

Config.debug = true

Shows:

  • Raycast hit points (red marker)
  • Entity bones (green markers)
  • Zone boundaries (colored boxes/spheres)
  • Entity outlines

Network vs Local Entities

Network entities:

  • Synced across all clients
  • Use addEntity with network ID
  • Required for multiplayer interactions

Local entities:

  • Client-side only
  • Use addLocalEntity with entity handle
  • Good for single-player NPC interactions

Future Updates

CU Enhanced Target is actively maintained and updated with:

  • New themes
  • Performance improvements
  • Bug fixes
  • Feature additions
  • Upstream ox_target updates

Check documentation regularly for updates.

Community & Support

Resources

Getting Help

  1. Read this documentation thoroughly
  2. Check the Usage Examples page
  3. Review Configuration options
  4. Contact CodeUniverse support for paid features
  5. Check Community Ox Discord for ox_target specific issues