Question - On logic's, how to make lift boundarys?

Hey my name Valentinas,

how to stop lift then using sensor activating motion then entering collision zone by player. Any help on limitating motion or making sensore one time activative?

What?

A lift has usually a few controls.

E.g.

up/down

or
floor selection (that is what we see each day)

The controls are at the elevator (not at the player). You have to think about how you make the control available to the user. That can be anything.

So you have two tasks:

A) let the lift react on the input
B) provide the user a way to deliver whatever he wants to this specific lift (e.g. let him touch an area).

You can look at the the door control. Maybe it helps you.

Well I can use radar to detect button and make it go one way becouse I will need this lift one time only and no extras. So I better drop blender file because you will WHAT? WHAT?? my.

collision player--------python

if move count min 0 max end–
Property On True------------------and-------------add 1 to moveCount
______________________________-------------motion

if moveCount= (end)------python2

python = add rigid body joint to player to lift (property on=True)
python2 = remove rigid body joint

Hey BluePrintRandom okay thanks you so nice to post code for every one who you don’t know. :slight_smile: Yeah I’am not exactly sure but have lead of what to do if I would use code any time soon. Any link to programing in bge import bge what next?

actually I just looked at your video,
have you considered a door?

collision with lift center object -------On = True

if On = true ------and-------close door
__________________-------move elevator

actuator sensor invert------and------open door
on=true--------------------------/

touching object closes door and moves,elevator and sets property true

if propertty true and elevator animation over open door?

A radar is heavy but can work. Ray and collision is more light weighted (in terms of processing time).

Regardless what you take it can return you an object. The best is when you filter it by property. E.g property “opener” for a door or “up”/“down” for elevator buttons.

Here you see that radar might not be the best solution as you can be able to detect several buttons at the same time.

This is usually not a big deal you just need to work out which button was meant. So this is more a selection mechanism.

When you know the selected button and the user wants to activate it (e.g via button, mouse button, menu button …) you tell the button to trigger whatever it is designed for. The button knows the door/lift it belongs too and can trigger the according actions e.g. via Python controller, message or property change.

So an elevator is not just a simple single object structure. It involves several objects and builds a complex system with several doors, buttons, status signs and at least one lift. Therefore I suggest to create Python code that describes the elevator model and/or control.

@Monster @BluePrintRandome - Thanks for all minds on this subject I will move now on making all this possibal today. Even post a result if something works out. If for real I will try to controll my colliding with motion stoping actuator. There must be way’s to unparent after collision with lift up sensor. Okay keep the good work on helping community.

https://www.blender.org/manual/game_engine/python_api/index.html from here I will learne

################## Move the game object a set amount

import bge

import bge

get controller

cont = bge.logic.getCurrentController()

get object that controller is attached to

obj = cont.owner

move game object 3.2 on the z-axis

move = [ 0.0, 0.0, 3.2]

use local axis

local = True

move the game object

obj.applyMovement( move, local)

Well i founded the way to move it up at certain location. I using mouse over sensor on button and parented button to lift which have python controller of “move_up.py”!!!

Can now some one give me a code sniffet on how to make this code in to loop of if statement? I think adding value by 0.2 till 3.2 would be just fine. :slight_smile:

Thanks

You can simply play an animation, or use a motion actuator. There is no need to do that on your own.

D3ar Monster,
Why you so rude I just wanted then to know how to add linear velocity and loop it. That would be done my way as initial idea. And don’t argue I know what’s best for my. And till then I using motion + actuator. :wink: