How do I make a flashlight mechanic with the 3d lighting?

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
A game with 3D terrain, realistic water and various 3D objects.
  • I'm trying to make a flashlight mechanic, but i can't find a way to make the light follow my mouse movement, can someone explain to me how to do it? If you could make an example project to be easier to follow i would be immensely grateful. I'm new to construct so i'm sorry if the answer is too obvious.

  • I’d start by checking that you’re getting the mouse position correctly in 3D space. It might be easiest to have a separate object for the light source and update its direction each tick based on the cursor position.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • first make sure youve added the Mouse object to the project, thats what gives you Mouse.X and Mouse.Y. then its just every tick -> set the light position to those, and itll follow the cursor. if you want it mounted on the player instead, position it at the player each tick and set the angle with angle(player.X, player.Y, Mouse.X, Mouse.Y) so it aims at the mouse. and if the light seems to do nothing, check its z position, a 3d light sitting inside or behind the geometry wont show up.

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