Please or Register to create posts and topics.

Toggle prop_button

Heya there,

Is there a way to make a prop_button toggle? Such as once pressed, does something. Then when pressed again, it does something else?

Just trying to wonder how this could be done, as I have no idea.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

Create a logic_branch and send it an input of ToggleTest each time the button is press, and add outputs to it for OnTure and OnFalse. For more than two possible cases, you'll want to use a combination of math_counter and logic_case.

Image
ImageImageImageImage
Rubrica wrote:
Create a logic_branch and send it an input of ToggleTest each time the button is press, and add outputs to it for OnTure and OnFalse. For more than two possible cases, you'll want to use a combination of math_counter and logic_case.

Thanks for the help. =]

However, I have encountered another problem. The prop_button toggles a panel that moves up/down. When it is in the 'up' state I place a ball on it, when I toggle it to the 'down' state...the ball stays there in mid-air.

All of the settings for the panel animations etc are correct.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

A ball as in... a companion sphere? The only thing i can think of is make sure your physics type in the panel model isn't "bounding box" and instead is Not Solid or vPhysics.

My Maps:
[spoiler][SP] Alternate[/spoiler]

Are you parenting an invisible brush to the panel? If you were to use the wrong attachment point, the brush would not move with the panel, and would hold the ball up.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder
Marise wrote:
Are you parenting an invisible brush to the panel? If you were to use the wrong attachment point, the brush would not move with the panel, and would hold the ball up.

I have parented it to the panel, and used the correct panel_attach to go with it. Unless you need a different one for an invisible brush?

@Vordmann, Yeah, a sphere. Sorry. The setting is set to 'not solid' for the animation and panel side to it.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||

Post the .vmf or something... if nothing else works you could parent the ball to a path_track for a short time to make it "fall"...

My Maps:
[spoiler][SP] Alternate[/spoiler]

You could activate a trigger_push with a really small force, maybe 10. Direction downwards. This should reactivate the spheres physic for a second and it will fall down.

Lostprophetpunk wrote:
I have parented it to the panel, and used the correct panel_attach to go with it. Unless you need a different one for an invisible brush?

It's the same attachment point for any brush. However, some panels use panel_top as the attachment point. You could test if it's attaching by temporarily changing the brush texture to something visible, and see if it moves with the panel.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder
Marise wrote:
It's the same attachment point for any brush. However, some panels use panel_top as the attachment point. You could test if it's attaching by temporarily changing the brush texture to something visible, and see if it moves with the panel.

I know the brush is attached, as I put the button next to the panel, stood on it and pressed it, I went up with the panel and came back down when toggled.

The brush stays on the panel as it doesn't get stuck in mid air.

Some of my Portal 2 maps || Mini-Faith || Careful Cube || Vertical Reach ||

|| Need help uploading a map...new user? Read my Map Uploading Guide ||
|| Want to play custom maps, but don't know how? Read my Playing Portal 2 Custom Maps Guide ||