Talk:Func rotating

From Valve Developer Community
Jump to: navigation, search

How would I make an entity of this type rotate about an arbitrary axis? --Bravo2 00:59, 13 Feb 2007 (PST)

Move the small circle that starts in the center of the object to where you want your axis to be. I beleive it will rotate around this point. --Daedalus 04:19, 13 Feb 2007 (PST)

That is true, however, that changes to an arbitrary ORIGIN and not an arbitrary axis. Imagine a disk spinning around an axis that is orthogonal to the plane of the disk, but the disk is tilted on its side. --Bravo2 15:57, 14 Feb 2007 (PST)

You can use the flags to make it rotate around the x y or z axis, but if you want to use a combination, you may need to do either of these (whichever works): give it initial "angles" value or parent it to a func_door_rotating which you then can rotate open to obtain the ideal axis you want. For things like this where there's no obvious answer, the best thing to do is combine multiple entities to get your desired effect.—ts2do 20:03, 14 Feb 2007 (PST)

The func_door_rotating worked like a charm. Just made it stay open (reset = -1) and then set the axis I wanted the other rotating object to be tilted on. If you use 3 doors, you can have it rotate about any arbitrary axis. Thanks guys. --Bravo2 22:55, 14 Feb 2007 (PST)

Rotating brushes in TF2

I'm going nuts trying to create a large rotating fan in TF2.

  1. Create normal brushes representing the fan blades.
  2. Create a small brush in the middle, textured with the Origin texture.
  3. Select the blades and the origin brush, then hit CTRL-T to associate with a func_rotating.
  4. Set the max rotation speed and blocking damage in the first tab.
  5. Set "start on" flag in the flags tab.
  6. Move the rotation axis marker to where the origin brush is.
  7. Profit!

I've also tried leaving out the origin brush. Either way, the best result I've got is the fan blades hovering motionless and immaterial in space, with invisible rotating brushes that will push me out of the way or hurt me depending on that setting. I've also tried adding prop models and parenting them to the func_rotating, but they don't move either.

What am I doing wrong?

--Gearloose

Update

Well, I give up. It looks like func_rotating works in the physics engine but not in the graphics engine. It's really easy to make a rotating invisible brush that will hurt players or push them around - basically what I described above, only make the actual brush invisible. However, all my attempts to create a visible object that rotates have failed. If anyone figures it out, please add a tutorial to the wiki.

---Gearloose

Did you try parenting a func_brush of the fan blades to an invisble func_rotating? --Angry Beaver 13:20, 9 Dec 2007 (PST)
Yup. I also tried changing the brush type properties of both between BSP and Vphysics, inspired by the hint in Hammer that says to use the BSP type if the brush is a child of a moving object and can be stood on. No luck. I also tried making static and dynamic props children of the func_rotating, and they didn't move either. --Gearloose


I'm trying to get this also, and It will not move parented objects. I can't even get it to rotate. (It only rotates when I stand on it, nothing else otherwise).
---Lord Ned
Did you turn the "Start On" flag? I have been able to get it to work and this is my first time using this entity. Also, did you make sure it spins on the right axis? --Frostyfrog 13:11, 15 May 2008 (PDT)


Alternative

One recommends making the brush you wish to rotate a "func_physbox" and using a "phys_motor" to turn it. The phys_motor uses the axis from the entity itself to it's helper node (white circle in 2D, blue sphere in 3D). This works in TF2. --Zeph

I want to rotate a entity (Prop_dynamic) I am gonna try your way Zeph, but I am going to use a func_physbox which will have a child phys_motor which will have another child the prop_dynamic. I am gonna repeate this for a prop_dynamic_override and another two but everything parented to the func_physbox. Seperatedly then, I will copy the a phys_motor and a physbox by themselves to see if those two alone work together. I will report on this soon
--Motanum

Workaround

TF2MAPS.NET -- Workaround for func_rotating. (all credit to BoojumSnark) --Tehrasha

Link is dead, if anyone has the tutorial or remembers it, then please make an article about it.
--Motanum
Link is not dead. tf2maps has been having serious DNS issues for the last few weeks. --Tehrasha

BoojumSnark's Workaround

Pulled from Google cache --Tehrasha 23:16, 14 January 2011 (UTC)

Basic functionality: Make your rotating entity the neglected oddball momentary_rot_button. Set the speed to what you need, and set the distance to a multiple of 360, this is important for making the rotation appear seamless. For purposes of of I/O efficiency, I recommend making the distance roughly 10 times the speed so that it takes around 10 seconds for it to complete it's distance cycle. Give the m_r_b the following:

OUTPUT	        TARGET	        INPUT
OnFullyClosed	rotate_relay	Trigger

Create a logic_relay and name it rotate_relay. Give it the following:

OUTPUT  	TARGET          INPUT	               PARAMETER	DELAY
OnTrigger	!activator	SetPositionImmediately	0.0	        0.00
OnTrigger	!activator	SetPosition	        1.0	        0.01
OnSpawn	momentary_rot_button	SetPosition	        1.0

Also enable the Allow fast retrigger flag on the relay. The last output will appear as a broken output in Hammer, but in-game it will be sent to every m_r_b in the map without having to name them.


Stopping & restarting: If you wish to stop an m_r_b once started send it the following sequence:

INPUT	DELAY
Lock	0.00
Unlock	0.01

The lock will stop it from moving and the unlock will allow it to be restarted again. To restart it send:

INPUT	      PARAMETER
SetPosition	1.0

Extra notes: To make an m_r_b rotate in the opposite direction, use a negative distance. The start direction key does not appear to do anything.

If you want to individually control multiple m_r_b obviously you will need to name them, but leave the logic_relay as it is, !activator will reply to whichever entity called upon the relay.


Bug

There seems to be a new bug from one of Valves server updates for Orange Box Games. (HL2DM, CSS, TF2) The console may spam this type of message "Bad SetLocalAngles (0.000000,-3601.493652,0.000000) on func_rotating. This will give the player small lag spikes depending on the number of func_rotating and speed its rotating.

Link References http://forums.nom-nom-nom.us/topic/15100-july-29-tf2-update/page__st__20

http://webcache.googleusercontent.com/search?q=cache:XUVAgPBiRlsJ:forum.i3d.net/1297782-post4.html+Bad+SetLocalAngles+on+func_rotating&cd=3&hl=en&ct=clnk&gl=uk

http://lmgtfy.com/?q=Bad+SetLocalAngles+

This was from the article User:Gtamike_TSGK --ThaiGrocer 08:16, 10 October 2011 (PDT)

45° and 90°

How can I make it turn exactly 45° or 90°? I can make it rotate and stop it around these values but after a few rotations (Example: 3 turns to the left then 3 turns to the right to set it back to the original position) somehow, it gets a little bit rotated so when I want to reset it I can't because it rotates (somewhere) a few extra degree's. I tried it with Acc/Dec on and off, tried setting Friction to 100 or 0. Nothing worked so far. I trigger it with the following inputs (rot2 is the func_rotate):

prop_button --> name: b1 , delay before reset: 1 , prevent fast reset: Yes
Output:
OnPressed --> rot2 --> SetSpeed --> -1
OnPressed --> rot2 --> SetSpeed --> 0 --> Delay: 0.25
prop_button --> name: b2 , delay before reset: 1 , prevent fast reset: Yes
Output:
OnPressed --> rot2 --> SetSpeed --> 1
OnPressed --> rot2 --> SetSpeed --> 0 --> Delay: 0.25

FIRE-Buzzard (talk) 16:51, 26 March 2019 (UTC)