Jake LMC's Forum Posts

  • You have a mistake in "Cast ray" action.

    In "to Y" field you have Player.X+2048*sin(angle(Player.X,Player.Y,mouse.X,mouse.Y))

    It needs to be Player.Y

    that would be my problem, sorry for being so dumb

  • Hitdistance would return 0 when the ray doesn't hit anything. Check that there are in fact obstacles and that you've configured them correctly in LOS behavior.

    Or maybe the ray hits the player object itself, or some other object attached to the player.

    It's difficult to speculate without the project file.

    apologies for the delayed response but ive done a bit of tweaking, and ive got it to "half work" of a sort. it is shooting the ray out past 0 pixels now, but it seems to sometimes randomly not go far enough, like, it will shoot out but it will fall short of the solid object, the distance it falls short of seems random, at some points it works perfectly and goes to the wall, at other times it practially goes nowhere, like 5 pixels out from the player when the wall is sat 500 pixels out. completely random. ill send the project file here:

    https://download1322.mediafire.com/67biei4kdr5gWOXfPnmzV3TJAQgSnjQiPaO54nrN4jT6H4F8ANUZE4gg0NLoDG2lWVlK42VW1Ogce2iKCcFmvpABWGKrVEIyInuLIjF1h1hBr6E3UCcDqZBVDHP30OwM-Edbrxr43FbGgXobfeQXzhAQ9KF561p5hEQ1c6QmZ3g9_jc/lwcth4qd9w2qzj2/2d+Platformer+Shooter+Game.c3p

    When ingame, you can use left click to shoot the laser, but you will find the length of the laser is seemingly random.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How do you know it doesn't work? The expressions look correct to me.

    Instead of raycasting, try spawning a test sprite at those coordinates and check if it appears in the expected location.

    huh you're right, no clue why the raycast wont work then :/

  • this is what i currently have. which doesnt seem to work

  • x=yourloc.x+dist*cos(theta) y=yourloc.y+dist*sin(theta)

    dist=2048

    theta=angle(yourloc.x,yourloc.y,mouse.x,mouse.y)

    Apologies but that didn't seem to work

  • so essentially, I want to get the x and y position of somewhere that is 2048 pixels away from my player character, but is also at the angle between the player and the mouse cursor. is this possible?

  • something like trove but on a smaller scale and obviously 2d not 3d. would that be possible using the multiplayer modules available?

  • Works fine for me. Your events seems to be correct. There has to be something else that prevent your object from rotating.

    i have no clue anymore, can i send you the project tmmr? i honestly dont know why it wont work.

  • everything but the clicking to turn the ship works here.

    actually wait, the physobject also doesnt turn when it is created.

  • heres the full event sheet so far

    everything but the clicking to turn the ship works here.

  • heres the full event sheet so far

  • it is because the ship can move around with WASD like i want it to, but if i try to click to make it turn, nothing happens.

  • Is your event sheet connected to the layout with the ship on it? Do you have more than one ship? I check the basic stuff first.

    yours

    winkr7

    yep, there is literally 3 things on screen, the ship, a test physics object for the ship to interact with, and a tiled background. and everything else works, just not the turning.

  • hey, i wanna make it so that when i click, my object will use physics to turn towards where im clicking/holding down my mouse. i thought it would be as simple as having the condition "Left button is down" activate the event "apply physics torque x towards (Mouse.X, Mouse.Y)". but this didnt seem to work, any help?

    forgot to mention as well, its not an issue of not enough force, ive tried setting it all the way up to 5000 with nothing different happening.