elevator

hi everybody.i have a big problem and i dont know how can i have an elevator in my game.that move up and down by pressing the related button.as the reality.thanks for your answer :slight_smile: im not professional in unity :frowning:

or do you have any assets related to this?

Mona, I see this is your first post to the forums, so: welcome!

You haven’t asked a very specific question, so I can’t give you a very specific answer. In general terms, I would make an elevator like so:

  1. Get or make a 3D model of an elevator. If you’re on a Mac, I recommend Cheetah3D for 3D modeling. If you’re a masochist (on any platform), I recommend Blender. If you have no interest in 3D modeling, then you’ll need to find an artist. (I don’t think you’re likely to find something this specific in the Asset Store.)

  2. Place the elevator in your scene.

  3. Attach a script to it. This script should have a couple of public properties that define the start and end points, and probably some additional ones to define the speed and acceleration. Then, in its Update event, check for the appropriate keys or input buttons, and move from one point to another when called for.

A script like this isn’t too hard to write from scratch, though if you’ve never done any Unity scripting before, you will probably want to go through some tutorials and do some simpler things first. If the lerping between the two endpoints worries you, you could always leverage a good “tweening” framework, like HOTween.

If you’re new to Unity, you will probably get stuck on one or more of the above steps. When that happens, come back here, and post a very specific question, including (a) what you tried, (b) what happened, and (c) how this differs from what you wanted to happen. Then we’ll have a decent chance of being able to really help.

Good luck!

  • Joe

thanks dear joe.im new to unity.i have the 3d model and i know steps 1 and 2.but my big problem is in script.
cuz i want an elevator that has some buttons and when the character press a button the door opens,then the character goes into it,then with pressing one of the buttons related to one level the elevator goes to that level and… exactly something that is happening in reality…and writing the script isnt easy for me

By “bottoms” do you mean to say “buttons”? If not, then I can’t make out what you’re trying to say.

Assuming you mean buttons, are these on-screen buttons, or do you mean keys on the keyboard (or on something like a gamepad)? If you mean on-screen buttons, are you drawing this in the OnGUI method, or using the new GUI system in Unity 4.6, or something else entirely?

(Details, details… you provide as many details as you can, and we may be able to help you out!)