Not sure, if its works in your project? Try these for help.
Targeting system
Download from asset store
Story:
How it started
I like to try new things, so one day I was going through vr-games got accross situation where using jedi powers was really cool, but it didn't work quite right. Sometimes pointing with hand selected the wrong object althought I was pointing at the right one. This was enough to make me lose few fights which eventually got me frustrated and made me take a break. Eventually I ended up changing tactics, but the same issue happened in other games.
Eventually I figured out that its most likely the developers fault. Usually developers can do anything as long as they have the time. After browsing assetstore I noticed that there was no targeting system of anykind. After trying few vr-plugins I eventually found out the plugin that had the object picking functionality, but it didn't work properly in every situation. Instead of using mathematics the plugin used collider to pick objects.
So I created this plugin to give developers more time to do their work on the game and forget about working with features unrelated to the game itself.
Purpose
This targeting systems main purpose is to make everyones life easier. By making games that can predict what users essentially want to do in their games, you can maximize customer satisfaction. This includes things like figuring out the object she/he is indirectly pointing at. This comes as a big savior, when you are dealing with devices that are due to their nature less precise than mouse. Even these precise devices can become clumsy to use when the size of the object is less than few pixels and this becomes a nighmare, when object is small and far away.
The targeting system is perfect for enchanting these kind of situations. It provides tools to change target groups and adjust what is being targeted.
Whats even better the plugin comes with the highest quality. The plugin is made with all the latest technologies. Including automated testing, performance, code coverage, code quality analysis (CRAP score). You might think can it be any better then I say yes it can. The plugin is fully opensource and contains online+ offline documentation.
Don't just take my word on it. Try the demo, look at the generated documentation.
Plugin details and information:
Information and details about the plugin.
Geometric vision targeting system 3 brings you object and optional entity based targeting. Targeting system is a plugin/component that can be added to your game object. This plugin/component can then be called for example getting closest target based on what the user is pointing at. In real games targeting systems are used on things like object targeting, enemy targeting/locking, aim assist, homing missiles, object snapping, turrets, click enhancers and even virtual reality headsets gaze detection. The plugin works similarly to Unity's camera component except it also comes with a runner component that can be configured for global settings accross many systems. One of the targeting systems core features are targeting actions and indicators. Build your own visual targeting indicators and effects by creating assignable action templates. You can even add audio clips to create targeting sounds. Project contains example scenes like in the video for demonstrating different use cases.
With the targeting system you can create wide variety of things. Such as:
-Easier object picking.
Pointing object far away is suprisingly difficult. Especially after the object is hidden under planks grass or too far away to be visible.
-Target locking for weapon mechanics like aim assist and target prediction.
Make targeting behaviours like weapons that never miss a head shot or lasers that always finds the needle in the haystack.
-Catch things from air.
In case you have tried to catch things in virtual reality, then you probably have noticed that it isn't exactly as easy as in the videos. I think good example is half life alyx. There is a scene where you have to catch a weapon from air. I couldn't catch it, but I'm 100% sure I could have catched the weapon, if it happened in real life.
-Weapons, pointers, item popups and spells.
With the prefab spawning system and various examples included, it is possible to create indicators, item popup helpers and else.
-Research on coming Unity features like dots stack.
Project contains examples on how to use the system for both game objects and entities. The examples show how to use targeting system on your custom scripts. This does require knowledge in programming, but it's made in a way that you can use the easy game object based workflows. In the examples it doesn't matter if the object is entity or gameobject you can move it with the implementations provided.
Other Features:
-Object and entity target culling system.
Targeting system operates in its own frustum space accessible to the outside. Have hundreds of thousands of targets scattered? If you are good programmer you can write your own targeting implementations or use the system for something other. Frustum culling is for transforms, entities and targeting datastructures.
-Automated runtime and performance tests
Automated runtime and performance tests make sure the next version keeps on working as intented. It loads test scenes and scenarios from hardisk and after tests have finished it restores changed build settings.
-Access to the source code.
By buying the product you will get MIT license access to the sourcecode. Please note that copying the product and reselling the same plugin at lower price is not permitted. In case you would like to contribute use the free version that is under GPL.
-Get targets arround the view direction.
-Entity and game object systems for deleting and moving gameobjects, entities and both.
Move target moves the target. It doesn't matter if its game object or entity
-Filtering of targets based on tags for game objects and scripts for entities.
Yes, it is possible to combine game objects like players and entity enimies in to the same target group.
-Entity and game object filtering on targets
Combine entities and gameobjects to the same target group based on tag and entity component.
What you get by purchasing the plugin:
-Plugin itself from the unity assetstore with MIT licence.
-Documentation.
-Examples.
-Help from discord channel or by email. Depending on how busy I am. I might ask for receipt or money for addittional development and features.
-By buying assets made with the tool you continue to support the development of the plugin.
And of course my eternal gratitude!
Features
For full list of features visit the asset store page.
System and project requirements
Operating system and platform support.
Package has been developed with updated windows 11 and windows version of the Unity editor.
If the packages mentioned above works on MacOs then I think the project should run fine.
I have only currently tested building on windows machine and virtual reality builds.