button triggers

Blitz3D Forums/Blitz3D Programming/button triggers

Zephar123(Posted 2003) [#1]
I want to add 3d elements that when tey are targeted and cliked events happen like an evlevator coming down. What is the most effeciant cammond to use for such a thing


WolRon(Posted 2003) [#2]
Haven't done anything like this yet, but maybe you could have a Pivot out in front of the player with a collision sphere set at a radius that feels right to you (something like the distance the players arm could reach out and be able to touch something). Then when the player presses whatever key that performs the button press action, you could check for a collision with the 'button' in the game with the collision sphere of the Pivot. If they collide, then 'trigger' your activity (i.e. elevator).


Zephar123(Posted 2003) [#3]
hmmm theres got to be a way to do some sort of camera pick on the mouse xy though to detect a left click.


Shambler(Posted 2003) [#4]
There is, use EntityPick(camera,range#) which will pick entities in the direction the camera is facing.


Zephar123(Posted 2003) [#5]
thanx shambler thats the ommand infact i picked and does look the best.


jfk EO-11110(Posted 2003) [#6]
I work on this too ATM. I use camerapick after mousehit(2) under the crosshair. I have animated Meshes as Buttons. The child that has to be clicked is named "button" in the Modelling App, so I can check if the player clicked the button part of the aniimated Mesh. I also have an Array that stores all Children-Handles of Meshes loaded using LoadAnimMesh as well as their top Parent-Handle. If I click such an "orphan" the Array will tell me what Parent-Entity I have to Animate. Of course this can also be solved using Types.