x


Building a NON-GUI button

I am trying to create a button in the game. Let me make it clear this is not GUI button, but an object in the game. It is cylinder, in a cylinder. When the player steps on it, the inner part goes down a bit, something happens(the easy part), when the player steps off of it, it returns to its normal position. I tried attaching a spring joint but I received very strange behavior. I had setting a connected body both above and below the button, but it would work the way I wanted. I would drop just a regular block on it, the button would depress, but when I moved the block off the inner cylinder would just kinda float away at odd angles, and it would not stop. Am I using the spring joint wrong, or is the spring joint just wrong to use?

more ▼

asked May 21 '12 at 11:14 PM

easilyBaffled gravatar image

easilyBaffled
92 15 29 38

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You might try messing around with the min/max distances for the spring joint? You might also want to make sure that the joint isn't breaking under force/torque -- I'm assuming that you never want this spring to break, so you should be able to set those tolerances extremely high.

If you can't figure this out, I've usually seen people do this sort of thing through an animation (or simple position lerp). Bit less dynamic, but easier to control and test as a result. Not to say a spring joint can't work, but you do have that option.

more ▼

answered May 22 '12 at 01:33 AM

rutter gravatar image

rutter
5.4k 2 11

Lerp has worked before, should work again. Just wanted to try something new, maybe for another time. Thanks

May 22 '12 at 03:03 AM easilyBaffled
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x820
x481
x9

asked: May 21 '12 at 11:14 PM

Seen: 297 times

Last Updated: May 22 '12 at 03:03 AM