Raycast broken?

Problems Koding something? Get help from other users here!
TheInventor
Newbie
Newbie
Posts: 11

Raycast broken?

Post#1 » Tue Apr 18, 2017 7:27 pm

I'm making a shooter game that uses raycast for the bullets. I use an invisible un-collidable sphere as a shield to protect from the bullets. I got all of that working, except the bullets only work with the shield part of the time.

Here's my problem. I have an object inside of the shield. I kode the bullet to play an effect at the hit position of the raycast, take away health if it hit something, and then delete.

If said object goes inside of the shield, and I shoot at the object, sometimes the bullet will damage the object inside, but not the shield, and play the effect on the edge of the shield as if it had damaged the shield (like it should).

Does anyone know what is wrong with it, or have any potential solutions? If I need to, I can simplify the world and upload it to SparkShare for you to try it out for yourself and help me fix it.

Thanks!

User avatar
LucidStew
Level 3
Level 3
Posts: 179

Re: Raycast broken?

Post#2 » Wed Apr 26, 2017 11:10 am

Are you sure it's raycast and not your kode? the effect sounds like hit position is correct. I've never noticed a problem with it, but it wouldn't surprise me if it was bugged. So many things in PS are.
End of line.

Brasten
Level 1
Level 1
Posts: 19

Re: Raycast broken?

Post#3 » Sun May 28, 2017 10:22 pm

What Object are you using for the Sphere? Is the Sphere object moving? When troubleshooting it's best to give as many details a possible.

In the past I've occasionally had some oddness with Invisibly and Non-collision, when it interacting with Raycasts and Detectors, but its hard to replicate. I cannot currently replicate what you're talking about. Using a Primitive Sphere and a very simple [Raycast] [Only Objects], to get the [VectVar: Hit Position] = [Output: Hit Position].

TheInventor
Newbie
Newbie
Posts: 11

Re: Raycast broken?

Post#4 » Fri Jun 02, 2017 9:31 pm

Brasten wrote:What Object are you using for the Sphere? Is the Sphere object moving? When troubleshooting it's best to give as many details a possible.

In the past I've occasionally had some oddness with Invisibly and Non-collision, when it interacting with Raycasts and Detectors, but its hard to replicate. I cannot currently replicate what you're talking about. Using a Primitive Sphere and a very simple [Raycast] [Only Objects], to get the [VectVar: Hit Position] = [Output: Hit Position].


I'm just using the Primitive Sphere, and it's not moving. I think I may have figured it out, but it may have to do with the object being behind the center of the sphere. I may need to do some more testing on this, but if the object is in front of the sphere's center but the sphere is still large enough to cover the object, I think that's when my problem happens. If I'm right, then it's just a project spark bug and I can't do anything about it and will just abandon the idea.

Return to “Koding Konversations”

Who is online

Users browsing this forum: No registered users and 1 guest