Jump to content

Raycast to the ground give ridiculous reading


Recommended Posts

Not really, no.

I've fought with this for quite a while for my Landing Height mod and sometimes the raycast just doesn't.

The two big caveats are:

1) Raycast only works in physics range, which I believe is 2400meters. Higher then this altitude the ground doesn't exist for the raycast to hit.

2) The PQS system has invisible grid objects of some sort that the raycast sometimes hits. I've never been able to figure out what or where they are so you have to compensate.

The best I've come up with is the code I used for my landing height mod as I use here. Note however I have the overall error trap at the end that falls back to using Vessel.PQSaltitude as a failsafe as raycasts are not 100% reliable.

D.

Link to comment
Share on other sites

On 11/18/2016 at 6:28 PM, Diazo said:

Not really, no.

I've fought with this for quite a while for my Landing Height mod and sometimes the raycast just doesn't.

The two big caveats are:

1) Raycast only works in physics range, which I believe is 2400meters. Higher then this altitude the ground doesn't exist for the raycast to hit.

2) The PQS system has invisible grid objects of some sort that the raycast sometimes hits. I've never been able to figure out what or where they are so you have to compensate.

The best I've come up with is the code I used for my landing height mod as I use here. Note however I have the overall error trap at the end that falls back to using Vessel.PQSaltitude as a failsafe as raycasts are not 100% reliable.

D.

Thank you, have you ever check how long would this glitch last? I implant a derivative prediction try to eliminate the glitch reading, but not working really well.I am told that wheel collider is also a raycast, do you know how does it works? Is it because of the mask?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...