Blender Game Engine Mouse Pointer



  • October 20, 2014
  • 510 Downloads
  • 0 Likes
  • Blender 2.7x
  • Render: Blender Internal
  • Creator: 3DHaupt
  • License: CC-BY-SA

Blender Game Engine: While mouse button is pressed. Custom mouse pointer slows the game down. Hot Network Questions Can a rogue radio signal from the moon or near orbit realistically go unnoticed? Optimal way of connecting N sensor to M devices in polynomial time? The controller consist only of a list of types of mouse events. A FALSE pulse is given when any of these conditions ends. Mouse over any Gives a TRUE pulse if the mouse moves over any game object. Mouse over Gives a TRUE pulse if the mouse moves over the owner object. Movement Any movement with the mouse causes a stream of TRUE pulses.

PreviousNext

Description:

Here are two controllable rocket types for the Blender Game Engine.

You can shoot those rockets with the left and right mouse button.

Rocket 1 (Left mouse button)

A Rocket which tracks the mouse cursor, as we know it from some Games.

Rocket 2 (Right mouse button)

A Rocket with a built-in camera is controlled by mouse movement.

Basic Controls:

P-Key.................Starts the Game Engine

W-Key.................Move forwards

S-Key.................Move backwards

D-Key.................Move to the right

A-Key.................Move to the left

Mickey Mouse Blender

Hold Spacebar.........Player moves faster

Q-Key.................Jump

F-Key.................Changed the daytime forward

B-Key.................Changed the daytime backward

This Blend file only works correctly with Blender 2.72 and with higher versions, i hope.

https://www.youtube.com/watch?v=JjOA38Ey8tg

Comments:

Blender Game

  • lawi01
    Edited October 21, 2014
  • 3DHaupt
    Edited October 21, 2014
  • Waldo81

    Is this working yet.. I wasted 14 MB on this yesterday..

    Written October 21, 2014
  • 3DHaupt

    Waldo81 do not download it again !!! :)

    Use 61 MB to download thenew Blender 2.72a, then it should work ;)

    I use Blender 2.70 at my employment-project and so I need to switch constantly between 2.70 and 2.72a because all the newer versions of Blender make some performance problems with thatproject (18fps) :(

    When I try this rocket thing I made in an older version than 2.72 I get a white screen and nothing goes as it should go, I guess you had the same problem.

    Written October 21, 2014
  • solarforge

    Super ! Thanks for sharing that, I am sure it will come in handy for many.I see you added in some very interesting scripts, GJ !

    Written October 24, 2014
  • ErfinGames
    Written January 29, 2015
  • alaska14
    Written April 17, 2015
  • brandon10
    Written December 29, 2016

< Blender 3D: Noob to Pro
previous module:
'Build a skybox'
• Table of Contents
• Glossary
next module:
'Text in BGE'
Engine

Mouse Pointer[edit]

Making a simple mouse pointer in the game engine.This takes up a lot of resources but it is very simple.

A little Python is involved but it is very easy to use and is only 2 lines of code.

  1. Open up blender and split the screen in two.
  2. Make the right screen a text editor and add a new text file with ALT+N. Type in the following code.
  3. Set TX: showpointer in the middle of the Text panel menu bar.
  4. Select an object that will always be available - preferably a camera.
  5. Go to the logic tab, add a 'Property' sensor, a 'Python' controller, an 'AND' controller and a 'Property' actuator.
  6. Activate the True Level Triggering (the “‘ button), set Prop: switch and Value: 0. Connect the property sensor to the python and AND controllers by dragging lines between the bullets.
  7. For the python controller set Script: showpointer.Note: If the value keeps being reverted to blank after setting it, the name you entered is not a legal script name; chances are you did not set the name of your script correctly. Look for the selection menu beginning with 'TX:' and make sure it says TX:showpointer.
  8. Now connect the AND controller to the property actuator. Set Prop: switch and Value: 1.
  9. Select Actor and click on Add Property make it a Int type and set Name:switch.

Now press P to start the game and now you`ll see your mouse pointer.

Blender Game Engine Mouse Pointer
previous module:
'Build a skybox'
• Table of Contents
• Glossary
next module:
'Text in BGE'

Blender Game Engine Mouse Pointer Download

Retrieved from 'https://en.wikibooks.org/w/index.php?title=Blender_3D:_Noob_to_Pro/Basic_mouse_pointer&oldid=3063528'