As my first "real" cheating project i decided to hack 7 days to die but used quite a lot of other people open source projects to be honest. However i was not able to find a way to move player camera to make it look at the target I want to. By using dnSpy I found that entityLocalPlayer has cameraTransform however "entityPlayerLocal.cameraTransform.LookAt(target.t ransform)" or "target.transform.position" didn't help me and didn't move camera anywhere.
So as of now I only have this workingsolution but I would like to change it to something else that works normal and doesn't send your mouse flying somewhere else with wrong settings or without manually slowing it down a bit in code And ACTUALLY locks on your target.
Code:
[DllImport("user32.dll")]
private static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
mouse_event(0x0001, (int)distX, (int)distY, 0, 0);