Correcting Mouse Aiming Orientation with 3D Cam

0 favourites
  • 6 posts
From the Asset Store
Basketball 3D
$7.50 USD
50% off
Template for a basketball game with a 3D aspect (illusion of 3D)
  • PROJECT FILE: https://drive.google.com/file/d/1rQl5A5qyTy9aqATJIThZrug-zGYu_uM4/view?usp=sharing

    ISSUE (SHORT VERSION): Using the Mouse to control the Aiming Reticule object is always "off-center" due to the way I have the 3D Camera set up to "lag" behind the position and while looking at the Aiming Retitule of the Player Character.

    ISSUE (LONG VERSION): The game I'm making is similar to Star Fox (SNES) or Space Harrier (arcade, etc). Unlike those games where the camera was generally stationary and always looking straight ahead, in my game, the 3D Camera is positioned behind the Player Character and adjusts position with a lag to move behind the Character again. The Camera always looks at the farthest Aiming Reticule object which is controlled by the Mouse.

    I'm using the difference between the present and previous Mouse position per tick to determine how much to move the Reticule. This much works. Sorta...

    The problem is that with the way things are now, the Reticule keeps moving to the bottom-right as the Mouse is moved around the screen and to dead-center when the Mouse moves to the top-left. I'm not sure what I'm missing.

    Could I get some help to resolve this, please?

  • newt R0J0hound dop2000

    Tagging the three of you because you've been the most helpful in the past and I value your input. (And because if one of you is unable to answer, maybe the others can.)

    Frederico C. from the Discord Ask-C3 channel offered me this solution - https://cdn.discordapp.com/attachments/253490735268102144/972991293246562354/3dRetical.c3p. And that's very close to what I'm trying to do but with the greater flair of the 3D camera viewing angles you can see in my own project.

    I tried to play around with the "Scroll layer" expression/action but I've never used it before so I'm guessing at what it actually does...

    I'm sure that my issue here is a lack of understanding of just how C3 is "thinking" when it interprets the event lines I've written. I'm obviously wanting it to do one thing but because I don't "get" how C3 handles certain details, such as 3D Camera in conjunction with the Mouse against a 3D layer, I don't know how to remedy this.

    I'll keep dinking around and hopefully I'll figure something out.

  • Just lerp the scroll.

    dropbox.com/s/zjbj5wi7i9zzzmb/3dReticalscrollerp.c3p

    ... and the squares.

  • So best I understand it the crosshair is moved with the mouse, and then the camera is moved so it's both looking at the crosshair and is behind the player?

    To do that I set the crosshair position to the mouse position on a 2d non parallax layer.

    To make the camera delayed behind the crosshair I positioned a lag object that lerps toward the crosshair.

    Then I calculate a unit direction vector from the player to the lag object.

    We can then calculate a position a certain distance behind the player to use as the camera position, and then look at the lag object.

    dropbox.com/s/h0pc8l4zl98f8kl/delayed_third_person_camera.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • newt - Thank you! I did try using Lerp before but was still struggling...the results I was after I couldn't figure out.

    R0J0hound actually seems to have solved it for me - a non-parallax 2D layer. That's like 90% exactly what I'm after (if not EXACTLY). I'm going to plug it into my setup and see if that solves the deal.

    Thank you both!

  • R0J0hound - THAT'S IT!!! IT WORKED! The Mouse controls the Reticule PROPERLY!!

    THANK YOU SO MUCH!!! (I'm 41 but the kid me feels like the best thing just got handed to me.) I'm very grateful.

    As always, I'm so appreciative of you both. GOD BLESS!

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