• Completely new to Lua, have a question
    2 replies, posted
So, as the title says, I'm completely new to Lua, and programming in general. I've been following <CODE BLUE>'s tutorials, and things are going pretty smoothly so far. I have one particular problem I'm stuck with involving GLua, and I can't seem to find anything on it. Basically I'm just trying to modify the chair thrower gun to spawn an entity at a specific angle while also using EyeAngles, in an attempt to "fix" the objects orientation. This is what I have; [CODE]ent:SetAngles( (angle(0,90,0)) + (self.Owner:EyeAngles()) )[/CODE] And it almost works, but when I aim up or down, (I think) the pitch and roll rotate in the wrong directions, relative to the new angle instead of just acting as an offset. Can post screenshots if what I'm saying doesn't make any sense. Apolagies if this is a dumb question, but any help would be appreciated!
Do not add angles. It will never work. Use RotateAroundAxis function. You can also try LocalToWorld functions. Search them on the wiki (in the side bar) to see how to use them.
Used the example on maurits.tv and it still doesn't quite do what I want it to, mostly because I have no idea exactly what it does and I'm still trying to wrap my head around everything. Thanks for the help though!
Sorry, you need to Log In to post a reply to this thread.