[Solved] Rotating the panel 90 degrees
I was wondering how I would rotate a panel 90 degrees every 10 second or so, much like in this video.
http://www.youtube.com/watch?v=oyAVJ3we ... 8index=19
The energy ball spawner is rotating 90 degrees on Y axis every 10 seconds or so.
Thanks in advance!
&&&&
func_door with more func_door's
MissStabby wrote:
wouldnt it be more practical to add a single func_rotating with a set speed (90 degrees a second) and having the start&stop being set at exact 1 second intervals by a timer?
The problem with this is that even though it might seem it will rotate exactly, if it turns enough times (or your computer lags) the func_rotating will eventually go out of line. Hence the need for a door or a func_rot_button.
chickenmobile wrote:
The problem with this is that even though it might seem it will rotate exactly, if it turns enough times (or your computer lags) the func_rotating will eventually go out of line. Hence the need for a door or a func_rot_button.
thats exactly the problem I am having. I have a panel that rotates 90 degrees when button is pressed. If I press it enough times, it goes out of sync.
How can it be fixed?
I made an amazing image just for you:
P.S. It spins on the z axis.
z
z axis is up in hammer.
It won't go out of alignment, but I don't know how you'd keep it rotating continuously. The button doesn't wrap around to rotate from 270 to 0, it rewinds. Perhaps momentarily toggling the startdirection keyvalue would help.
Kasc wrote:
I made an amazing image just for you:P.S. It spins on the z axis.
z axis is up in hammer.
Yes Z is up in hammer. I have a 3d background where Y is up. Anyways, thanks for the image but what I am trying to do is completely different. I have a panel that is standing up (like a wall) and I need it to turn 90 degrees on Z axis when the button is pressed so the player can make a portal on it from each corner of the room and I need it to rotate 90 degrees exactly so that the players can press the button as many times as they wants and not go out of sync.
dhavalmistry wrote:
Anyways, thanks for the image but what I am trying to do is completely different. I have a panel that is standing up (like a wall) and I need it to turn 90 degrees on Z axis when the button is pressed so the player can make a portal on it from each corner of the room and I need it to rotate 90 degrees exactly so that the players can press the button as many times as they wants and not go out of sync.
So is there more than 2 possible directions for the panel to turn?
If there is just two you could be crafty and use a panel with the right animation. Then use either a logic_branch or a math_counter with a logic_case to set the correct animation.
This will also make it look more Portal 2 style.
chickenmobile wrote:
So is there more than 2 possible directions for the panel to turn?
If there is just two you could be crafty and use a panel with the right animation. Then use either a logic_branch or a math_counter with a logic_case to set the correct animation.
This will also make it look more Portal 2 style.
No, I only want the panel to turn in one direction.
dhavalmistry wrote:
No, I only want the panel to turn in one direction.
Four directions then?
chickenmobile wrote:
Four directions then?
Press the button --> Panel turns 90 degrees counter clockwise
Press the button again --> Panel turns another 90 degrees counter clockwise (180 degrees from starting position)
Press the button third time --> Panel turns (180+90) 270 degrees
Press the button 4th time --> Panel turns (270+90) 360 degrees a.k.a. starting position.
and it keeps doing that as long as the player wants.
Rand0mNumbers wrote:
Try a momentary_rot_button and send it SetPosition inputs. That's what is used in here: http://www.youtube.com/watch?v=-Epr3khsZUgIt won't go out of alignment, but I don't know how you'd keep it rotating continuously. The button doesn't wrap around to rotate from 270 to 0, it rewinds. Perhaps momentarily toggling the startdirection keyvalue would help.
Hey, I tried doing like you suggested but its not working. Maybe I am doing something wrong. Is there a vmf I can look at or can you make me one with a room and one panel rotating on press of a button please?
Thanks in advance!
Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.
Output, Targetname, Input, Parameter, Delay
button:
OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01
doorparent:
OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0
Kasc wrote:
Just an edit of my image is what you want, but the button tells the door to open and not the OnFullyClosed output.Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.Output, Targetname, Input, Parameter, Delay
button:
OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01doorparent:
OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0
I am at work right now so I cant test but just by reading it, it makes sense!
Kasc wrote:
Just an edit of my image is what you want, but the button tells the door to open and not the OnFullyClosed output.Targetnames:
panel - the thing you want to rotate
doorparent - the thing panel gets parented to that's got a distance of 90 and set to rotate along the same axis as the panel
button: Button to rotate the panel.Output, Targetname, Input, Parameter, Delay
button:
OnPressed, !self, Lock, , 0
OnPressed, panel, SetParent, doorparent, 0
OnPressed, doorparent, Open, , 0.01doorparent:
OnFullyOpen, panel, ClearParent, , 0
OnFullyOpen, !self, Close, , 0.01
OnFullyClosed, button, UnLock, , 0
You my friend are a GENIUS!! 
It works!!
dhavalmistry wrote:
Hey, I tried doing like you suggested but its not working. Maybe I am doing something wrong. Is there a vmf I can look at or can you make me one with a room and one panel rotating on press of a button please?
Thanks in advance!
From your last post, you have it working, but I've attached the vmf anyways.
I don't know how to stop the panel from wrapping around. Math_counter handles integers, but not doubles, so I don't know what to do right now.
Pressing the button will place the panel in 4 different positions sequentially. Once you reach the end, it will rewind itself and start again.
Rand0mNumbers wrote:
From your last post, you have it working, but I've attached the vmf anyways.
Yes I have it working and thanks for the vmf. I am sure I will learn a thing or two from your map!