Jump to content

rotating objects with camera move


Xwad

Recommended Posts

Is it good?

  
local weapon = createWeapon("m4", -2376.80, -578.50, 132.3) 
setWeaponState(weapon, "ready") 
   
  
Function bindFire () 
  local rotX, rotY, rotZ = getElementRotation(weapon)  
  local x, y, z = getElementPosition (weapon) 
  local x, y, z = getElementPosition(source) 
  local rotX, rotY, rotZ = getElementRotation(source)  
  
  setElementRotation(weapon, findRotation(x,y,rotX,rotY) ); 
end 
addEvent( "bindFire", true ) 
addEventHandler( "bindFire", localPlayer, bindFire ) 
  

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...