BGE Tutorial: Custom Mouse Cursor!

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 52

  • @cubescript
    @cubescript 8 лет назад +28

    here the script guys,
    from bge import logic
    controller = logic.getCurrentController()
    own = controller.owner
    mouse = controller.sensors['Mouse']
    hitPosition = mouse.hitPosition
    own.worldPosition.x = hitPosition.x
    own.worldPosition.y = hitPosition.y

  • @mkrGameStudio
    @mkrGameStudio 7 лет назад +11

    People i found the error i found the error, Change hit X for Hit Y
    try this one
    from bge import logic
    controller = logic.getCurrentController()
    own = controller.owner
    mouse = controller.sensors['Mouse']
    hitPosition = mouse.hitPosition
    own.worldPosition.y = hitPosition.y
    own.worldPosition.x = hitPosition.x
    Ihope have helped

  • @AngelCnderDreamer
    @AngelCnderDreamer 9 лет назад +3

    Finally! Thankyou so much! for making this, you have no idea how much this means to me! And I am sure for others as well! :D

  • @quinten2083
    @quinten2083 8 лет назад +1

    is there an easier way to add a second mouse (a pointing cursor)? i want to keep the original mouse but as soon as i hover over some objects i want the mouse to change to a pointing cursor, like in a browser!

  • @miracleshappen4483
    @miracleshappen4483 8 лет назад +2

    I've followed every step religiously but when I press P (play) the mouse doesn't move. I'm using Blender 2.78a.
    I've checked the script and it doesn't contain any errors. Python console says that some names have not been defined (eg:; mouse, hitPosition)...

    • @niggamanjr
      @niggamanjr 7 лет назад

      me to, im using 2.77

    • @franklucas705
      @franklucas705 7 лет назад

      try putting cursor.py instead of just cursor. sometimes bge doesnt read scripts without the .py

    • @mkrGameStudio
      @mkrGameStudio 7 лет назад +1

      i found the error, Change hit X for Hit Y
      own.worldPosition.y = hitPosition.y
      own.worldPosition.x = hitPosition.x

    • @zainraza1073
      @zainraza1073 7 лет назад

      THANK YOU SO MUCH FOR THE FIX, THO.

    • @ild4099
      @ild4099 6 лет назад

      Doesnt work!

  • @nemescraft
    @nemescraft 9 лет назад

    I wonder why it doesn't work for me...
    Does it work the same with a 3D mouse?

  • @earthsteward70
    @earthsteward70 3 года назад

    Thank you good sir! your code actually works.

  • @opensourcereproduction8433
    @opensourcereproduction8433 7 лет назад +2

    why u stop making tutorial u r tuts r awesome

  • @MrandMrsGamerCouple
    @MrandMrsGamerCouple 9 лет назад

    for medium users i think this is what you want 8:56 , and thanks for this SuperGloop!

  • @natgazer
    @natgazer 5 лет назад

    Thanks

  • @Zyvo2
    @Zyvo2 8 лет назад

    Worked perfectly, thanks.

  • @lemane9906
    @lemane9906 9 лет назад

    I have a default cursor over custom cursor in another scenes. But in scene with only custom cursor everything is good! What do I need to do?:(
    P.S. Blender 2.74

    • @lemane9906
      @lemane9906 9 лет назад

      Alex Fallen ohh, I have already understood, anyway thanks for the lesson!

  • @blendergime2587
    @blendergime2587 6 лет назад

    didnt work in blender 2.79

  • @drenibrahimi4249
    @drenibrahimi4249 8 лет назад

    It worked ! Thank you.

    • @cicerooo
      @cicerooo 8 лет назад

      What did you do? It doesn't work for me either.

  • @drenibrahimi4249
    @drenibrahimi4249 8 лет назад

    Doesn't work

  • @kecyjhony3230
    @kecyjhony3230 5 лет назад +1

    Thank you.
    o script no comentario de MKR PRODUCTIONS funciona perfeitamentamente na versão 2.79.

    • @julionovaes3670
      @julionovaes3670 4 года назад

      opa tentei na versao 2.80 e o mouse fica voltando pro ponto de origem quando tento move-lo, sabe me explicar o pq?

    • @kecyjhony3230
      @kecyjhony3230 4 года назад

      @@julionovaes3670 tente copiar o código escrito no comentário do Cube 2 ou do MKR Productions.

    • @julionovaes3670
      @julionovaes3670 4 года назад

      @@kecyjhony3230 ent, eu descobri o que tá dando erro. Estou tentando fazer com que o cursor do mouse só apareça quando clicar Esc pra abrir o menu, mas quando faço isso o cursor parar de funcionar e fica estático no lugar

    • @kecyjhony3230
      @kecyjhony3230 4 года назад +1

      @@julionovaes3670o cursor é uma scene (cena) que deve se sobrepor a outras. Quando o menu abrir também deverá ser adicionado a scene do cursor sobrepondo a cena do menu. Desculpe se não pude ajudar, minha máquina está em manutenção.

  • @MnowGamedev
    @MnowGamedev 4 года назад

    consegui para camera 2d era so nomear o eixo x para y e o eixo y para z

  • @zyugyzarc
    @zyugyzarc 5 лет назад

    PROTIP: Use hitPosition.x , hitPosition.y and hitPosition.z for other mouse applications...

  • @aliali-tm7dw
    @aliali-tm7dw 3 года назад

    it dosent worked!!!

  • @cubescript
    @cubescript 8 лет назад

    well, dont work with out a mouse? (notebook)
    EDIT: work man, thanks, blender v2.77

    • @Zyvo2
      @Zyvo2 8 лет назад

      A notebook should have a mouse, If not I feel sorry for you trying to use blender with it. Also they do have mice you can buy that plug into a usb slot. I am using a notebook and a usb wireless mouse currently myself. (Not Suggested, I get ~8fps on this thing)

    • @cubescript
      @cubescript 8 лет назад

      haha lol lol, i ended up getting used Blender without a mouse, i use Shift + F to enter in the free camera mode, so I can move the camera, it's just complicated to organize the logic blocks... XD

    • @Zyvo2
      @Zyvo2 8 лет назад

      Since I get only Like 6-8 FPS when in blender on the notebook, I can't use Free Camera Mode, It's too laggy.

    • @cubescript
      @cubescript 8 лет назад

      lols 8 FPS? It is better to use the blender without this wireless mouse... :P

    • @Zyvo2
      @Zyvo2 8 лет назад

      it's not the mouse that gets 8fps, it's the computer. It's probably 8+ years old, Intel Atom CPU, Intel 945 GPU, and only 2GB Ram. This Computer sucks, but Until I move out, I'm not risking a Bat + 20+ Stairs to my Dell.