As most of us I went for servo based aiming, but when I plugged the standard method of directly converting the position of the analog joystick to the position of servo I realized quickly it has it's cons.
Direct control is great for steering and quick action e.g. spray type shooting, but it's not precise enough for a carefully aimed sniper shots.
So what's the alternative? Well an alternative could be a motion system which depending on the position of the analog increments or decrements the position of the servo.
My analog joystick also has a click in button, which I decided will be used to switch between two systems.
In the example below I will be using just one servo, to demonstrate the concept and aiming on one plane, but another servo can be easily implemented to make it a 3d aiming system.
This simple and smooth code runs really well without much delay. You can see the effects in the video below.
Comments
Please log in or sign up to comment.