Re: How to make FPS rifle always point to middle of the screen?

Thanks. I think I need to rotate the arms up/down for this. How do I rotate them (point the c++ function to rotate bones) given the camera rotation? The templates rotate the entire character.
[EDIT] improved english
You should look into Animation Pose Modifiers. Specifically the IKTorsoAim pose modifier. This is the exact method used in GameSDK to rotate the weapon and the arms and make the weapon always point to middle of the screen. You can see the effect of this in GameSDK if you try disabling the "g_stapEnable" console variable. When you disable that it looks the same as the game templates.

See line 8502 onwards in Player.cpp as well as the IKTorsoAim_Helper and WeaponFPAiming classes in the GameSDK project for reference.

Also have a look at the slides in the documentation explaining the different approaches that can be taken to achieve this. Unfortunately it's not as easy as it seems.
My Youtube Channel

Who is online

Users browsing this forum: No registered users and 2 guests