function LookingDirection()
local controllable = netuser.playerClient.controllable
local char = controllable:GetComponent( "Character" )
local forward = char.forward -- This should be a forward vector.
local pitch = char.eyesPitch -- You can use angles if you'd prefer
local yaw = char.eyesYaw -- You can use angles if you'd prefer
-- Convert unit circle angle to compass angle.
-- Known error: char.eyesYaw randomly returns a String value and breaks output
local direction = (yaw+90)%360
return direction
end
From the wiki why doesn't this work
Discussion in 'Rust Development' started by Locnar, Nov 8, 2014.
-
Because your function doesnt get a netuser.
-
Wulf Community Admin
Are you developing for Legacy or Experimental? The wiki is for Legacy, and you posted under Experimental.
-
Experimental? sorry didn't know wiki was for legacy
-
Seems like we don't have a wiki for Experimental. Strings and some hooks seems to changed a bit and others are missing if compared to old Rust.
-
Yea, the wiki is only for Legacy and will not apply to Experimental at the moment. At some point I guess we'll ditch the wiki and make a new one for Oxide 2. For now, your best bet is to look at other Experimental plugins and maybe poke around in the Rust Server source code.
-
Wulf Community Admin