Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Why is my logic gate only outputting once?

edited March 2019 in Bugs
Ok so im trying to make a moving car ai for a racing game, so i have it so when the card detects a wall on the right AND a wall it front of it, it turns left. But in order for this to work I need the logic gate to constantly have an output, but it's not doing that...


EDIT: now rays are outputting a "miss" and A "hit" at THE SAME TIME, HOWISTHATPOSSIBLE?


  • edited March 2019
    [Please leave the link to the game when asking about a problem or for help]

    They're actually outputting multiple times, Its just the raycasting angles isn't rotating with the object.
    Also why it stopped is because the bottom raycast isn't reaching the bottom wall anymore.

    Another reason why this wouldn't work is because you're using 2 different walls. You would need several more raycasts to detect every angle for 2 different objects.

    There are 2 solutions I can think of (and one of which I tried):
    1. Rotate the raycast angles with the rotations of the objects.
    And make a 1 wall objects that all 3 raycasts can detect.
    Another problem is the angle lengths are too short, but too long (90) won't let the object straiten up.
    The object will running into/along the walls, but will be able to complete several laps.
    I didn't go any further than this, but a way to solve a better AI is to create another set of raycasts for
    only when the object actually hits the walls.


    2. Use 8 different raycasts to detect every angle that you could hit from the 2 walls.
    You still may need to use 1 wall, but in a way this could help solve the problem in a different angle.
Sign In or Register to comment.

| make games in your browser
@ 2017, All rights reserved.

Contact us

Get In Touch