• local var = othervar only references the original variable?
    3 replies, posted
[CODE]local ang = JR.SpawnAngles ang:RotateAroundAxis(ang:Up(), -90)[/CODE] This changes the original variable stored in JR.SpawnAngles, is that normal behavior? What I want it to do is to create a copy of the original variable, and only change the temporary copy.
Create a copy by creating a new angle with the same pitch, yaw, and roll.
[QUOTE=code_gs;49567975]Create a copy by creating a new angle with the same pitch, yaw, and roll.[/QUOTE] What's the proper way to do that, then, if I can't directly reference the original angle? My first though is something like this, but it's probably not the correct way to do it: [CODE]local ang = Angle(0,0,0) + JR.SpawnAngles[/CODE] Edit: It worked, but I am still wondering if that's the "proper" way to do things, or if I just stumbled across a workaround
[url]http://wiki.garrysmod.com/page/Vector/Set[/url]
Sorry, you need to Log In to post a reply to this thread.