How do I make a ray trace return that it's starting inside an object?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I used to use a different raycasting plugin for allowing my platforming character to grab ledges, but I've tried to switch to the upgraded Line of Sight plugin instead so that I don't have to rely on a third party plugin. The issue I'm having now is that the character grabs the top and bottom of objects when he should only grab the top. I have to assume this is due to a missing functionality in the LoS plugin that the JCW_Trace plugin had: hitfrac. Any ideas on how to make a check like this? I've attached an image of my code below, but I can provide more info if needed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't know much about your specific implementation, but did want to suggest the possibility of using invisible hitbox helper sprites either at the corners or all along the top edges of a platform to trigger ledge grabs instead.

  • I've now confirmed that the issue is caused by the ray trace starting inside an object and there's no baked-in way of detecting that. That's how we prevented this issue with the old plugin; it has a hitfrac check I can call on to see if the trace started inside an object and respond accordingly. Ashley is that a functionality that's being considered for the LoS behavior, or does anyone have a suggestion on how I could test for that using existing functionality? Testing the normal angle isn't going to work because it returns the same whether it's on the top or bottom of the platform.

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