Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HERO_ANGLES = {} -- this is a workaround to the SetAngles problem. by keeping a record of the angles myself
- -- I don't have to worry about them getting set to something else on the next frame. however, it does cause some twitchiness
- -- when something (I don't know what) overrides the angles of the unit after I do my SetAngles using HERO_ANGLES
- function GameMode:MouseMove(info)
- local playerID = info.PlayerID
- local hero = PlayerResource:GetSelectedHeroEntity(playerID)
- local x = info.difX
- local y = info.difY
- if type(x) ~= "number" or x == nil then
- return
- end
- local angles = hero:GetAnglesAsVector()
- if not HERO_ANGLES[playerID] then
- HERO_ANGLES[playerID] = angles
- end
- HERO_ANGLES[playerID] = Vector(GameMode:ClampPitch(HERO_ANGLES[playerID].x + (y/5) ), HERO_ANGLES[playerID].y + (x/2.5), HERO_ANGLES[playerID].z)
- --hero:SetAngles(angles.x + (y/3), angles.y + (y/2.5), angles.z) here was my code before the workaround where I didn't keep track of the angles myself and I used the game's GetAnglesAsVector
- hero:SetAngles(HERO_ANGLES[playerID].x, HERO_ANGLES[playerID].y, HERO_ANGLES[playerID].z)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement