playMaker

Author Topic: Sphere Cast  (Read 2857 times)

Nog

  • Playmaker Newbie
  • *
  • Posts: 47
Sphere Cast
« on: August 04, 2016, 01:49:19 AM »
Hello,

If the radius of the sphere cast can be adjusted, is it possible to create a sphere or cylinder shape around a game object using a sphere cast? I am picturing a ray cast line that is much thicker than it is long.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Sphere Cast
« Reply #1 on: August 04, 2016, 08:50:57 AM »
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Nog

  • Playmaker Newbie
  • *
  • Posts: 47
Re: Sphere Cast
« Reply #2 on: August 04, 2016, 03:40:51 PM »
Thank you mdotstrange. If the capsulecast was used around a character or game object, could the capsulecast be used to trigger events like the Trigger Event acion? I noticed that it mentions that "CapsuleCast will not detect colliders for which the capsule overlaps the collider." I suppose that would not make it very reliable. By any chance, is there a Playmaker action for the capsulecast? Again, thank you for the help.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Sphere Cast
« Reply #3 on: August 05, 2016, 08:43:13 AM »
All of the casts can return the hit object from then which you can get the tag and layer of the object- so yes, you can use it like a trigger event-

About the overlapping- I would test it first as it might do the job- a collider set to trigger will miss some overlapping objects as well if only using On Trigger Enter- you have to use On Trigger Stay to catch everything-

There's also OverlapCapsules https://docs.unity3d.com/ScriptReference/Physics.OverlapCapsule.html which get the overlapping objects but only return colliders- but you could filter the hit colliders to find specific tagged objects etc-

If the action exists it would probably be on Ecosystem-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!