Benderama's Forum Posts

  • Sorry, I forgot to mention in regards to your solution I also don't believe it will work because there's too many other variables like the shape and obstructions. It might work ok if you've got a clear shot from the camera to the object and it's a box. But if it's a pyramid and/or it's partially obstructed from the camera and you click on it... Gonna be some crazy math to figure if it's actually being clicked on.

  • I don't think it can work as there's no ability to set a Z axis for the line of sight behavior (Or pretty much any existing functions).

    I was messing around with basically firing a sprite from the camera to where the user clicks by means of the move to behavior and manually adjusting the z elevation of the sprite as it moved which can sort of work because collisions are detected. But ran into issues with regards to speed and the thing moving so fast it was going through the object being clicked on and not detected.

    So my solution thus far is instead of having the behavior move the sprit is to create a loop based on the distance from the camera to the click location and iterating through moving the sprite 1 px at a time and checking for collision.

    First test seemed to work but lots of tweaking is needed. But now I'm thinking "ok, so that could work for clicks but what about hovering?"

    The mechanics of using this just seem so horribly inefficient. I really think the correct solution here is for the devs to actually code this simple functionality into the game engine.

    Thanks for your suggestion though

  • According to that thread it's a feature not a bug. Oh well, workaround works great thanks!

  • Use the line of sight behavior to cast a ray. On intersect, check the angle of the click with the hit distance and compare with the object height and z elevation.

    This is where you lost me... Not sure where I'm seeing options for angle of click or hit distance.

  • Trying to figure out why this doesn't work as expected. Basically, I've got a right click event with a sub event that spawns objects based on an array contents then a second sub event after that which tries to count/manipulate those newly created objects. However Construct doesn't seem to be aware that those objects exist until after the entire event and all sub events have fired. And even then it can mess up counts.

    See this project for a demo.

    1drv.ms/u/s!AsCiRwGRl1ngnJMAafrdXhe_nf9ihg

    In the demo right click on the screen and it will spawn 5 boxes. There is a text field that is supposed to display how many boxes there are just after they are created but it says 0. Additionally, the directive after that to change the box sizes doesn't work because it doesn't think there are any boxes. Then if you right click again it thinks there are 10 boxes where there are only 5 and the size directive still doesn't fire.

    Any insight here would be appreciated.

    I'm using r268

  • Seems that the click event only fires when clicking the plane where the 3d object is on. Like looking straight down on top of the 3d object I can click but if I'm looking at it from the side I can't.

    I can't see to find how I can click any side of the 3d object with a camera looking from any angle to fire the event.

    Thoughts?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just curious if there is a way to setup Cylinders or Spheres with the new 3D system. I'm thinking of all the possibilities with this but keep coming back to a potential need for these shapes. Maybe there is a way to handle this that I'm not thinking of?

    Thanks!