Thanks, but it only slightly helped :) For some reasons the camera doesn't changes back when I release the mouse button. I checked and StopAiming actually gets called, but it seems that CAM_ToThirdPerson doesn't do anything :(
On Thu, Sep 8, 2011 at 3:23 PM, Igoreso <[email protected]> wrote: > My guess would be to remove > if( m_SFRLocal.m_bAiming ) > or replace it with something else. > Everything else seem ok. > > > Hi, I'm trying to have the camera switch from third person to third > > person shoulder when the user holds the right mouse button. here are > > my methods on the client and server : > > > Shared: > > int buttonsChanged = m_afButtonPressed | m_afButtonReleased; > > > if( buttonsChanged & IN_ZOOM ) > > { > > if( m_nButtons & IN_ZOOM ) > > { > > StartAiming(); > > } > > else if( m_SFRLocal.m_bAiming ) > > { > > StopAiming(); > > m_nButtons &= ~IN_ZOOM; > > } > > } > > > Client: > > void C_ASW_Player::StartAiming() > > { > > ASWInput()->CAM_ToThirdPersonShoulder(); > > m_SFRLocal.m_fTimeNextAim = gpGlobals->curtime + 0.5f; > > } > > > void C_ASW_Player::StopAiming() > > { > > ASWInput()->CAM_ToThirdPerson(); > > m_SFRLocal.m_fTimeNextAim = gpGlobals->curtime + 0.1f; > > } > > > > Server: > > > void CASW_Player::StartAiming() > > { > > StartWalking(); > > m_SFRLocal.m_bAiming = true; //local player data > > m_SFRLocal.m_fTimeNextAim = gpGlobals->curtime + 0.5f; > > } > > > void CASW_Player::StopAiming() > > { > > StopWalking(); > > m_SFRLocal.m_bAiming = false; //local player data > > m_SFRLocal.m_fTimeNextAim = gpGlobals->curtime + 0.1f; > > } > > > > > For some reasons the camera doesn't behave correctly and stays > > stuck in either third person or third person shoulder... > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > >
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

