How do I lock cursor at the center of my game screen w/ 3D Camera ?

0 favourites
  • 3 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • Hello !

    So I'm trying to build an FPS type game and I need the cursor to lock at the center of the screen as I want to have an object's position to be at the center of the screen in the 3d world. Kinda like in minecraft, you'll have the block overlay selection following the center pointer.

    How do I do that ? I also tried to just set the position of my object to the center of the screen but idk how. I tried with camera look but it doesn't work, same with foward.. Idk what to do at this point.

    If you guys could help me, I'd be happy :D

    Have a nice day !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey Hey. Are you running version r276, the latest stable release?

    There is an example called "Foggy Outbreak". Just search "foggy" on the start page and it will come right up. You might find checking out the Event Sheet in the example helpful.

    It basically "Requests pointer lock", if the mouse does not have "pointer lock" yet, and that Action is within an "On any click" Event using the Mouse Object.

    As far as, placing a sprite/object at the center of the screen within the 3D Game. Take a look at the "GunOverlay" group within the Event Sheet in that example to get a general idea on where to begin with that aspect.

    The built in examples of Construct are extremely helpful. You can learn a lot just by deconstructing the Event Sheets within them, and figuring out how different game mechanics have been created in the examples provided.

  • Hey Hey. Are you running version r276, the latest stable release?

    There is an example called "Foggy Outbreak". Just search "foggy" on the start page and it will come right up. You might find checking out the Event Sheet in the example helpful.

    It basically "Requests pointer lock", if the mouse does not have "pointer lock" yet, and that Action is within an "On any click" Event using the Mouse Object.

    As far as, placing a sprite/object at the center of the screen within the 3D Game. Take a look at the "GunOverlay" group within the Event Sheet in that example to get a general idea on where to begin with that aspect.

    The built in examples of Construct are extremely helpful. You can learn a lot just by deconstructing the Event Sheets within them, and figuring out how different game mechanics have been created in the examples provided.

    Thank you for helping me ! Sadly this is not my issue :(

    I have a hard time explaining it : I wish to position an object in the 3d layer at the exact position where the camera is pointing at. So basically I could use mouse.xy but the pointer doesnt automatically lock with the pointer at center of the screen :

    Here I want my red square to be positioned at all time at the center of my screen instead of only the cursor. If i lock my cursor it will follow it but it won't be at the center.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)