|
TUTORIAL 4 GAME BLENDER & PYTHON 2/2 In this part of the tutorial, we add a strand of logic which utilizes the script and demonstrate a possible application for it. 1°) Normally, the logic of the camera is set up as follows: Therefore, add a String property, Name: "clic"
with a value of "off", then: Which produces: 2°) Now, the script will work. If you press P to begin Play
mode, the Empty (Target) will be placed where you click and this
will happen, whatever the position of the camera is (Note: it
must be directed downwards). Connect, parent (ctrl-P) any object
(Perhaps an IcoSphere scaled down by a factor of 0.3) with the Empty
if you want to see something, because the Empty is not
visible in Play mode. (Note: If you are using the downloaded file
"gbtut4.blend", you may wish to switch to Wireframe
display mode [z] so that you can view the object placement
properly). 3°) Voila, we are finished! Now, just for the fun of it,
create a car with:
Obviously you must add a ground with a ground property and
materials with suitable dynamic parameters (to obtain proper
movement for the car): 4°) You should now have a small car which goes where you tell it to! Now you know a little more about the obscure Python. Do not hesitate to study the scripts from other games and also read the documentation provided by Jan Walter at http://www.janw.gothere.uk.com/ Here is my small example file in case you have any problems. |
Today : Blender version : 2.12
|