Search Issue Tracker

Won't Fix

Votes

1

Found in

2017.2.0f3

Issue ID

976983

Regression

No

Physics.Raycast maxDistance field accepts LayerMask object as valid input when using Physics.Raycast()

Scripting

-

To reproduce:
1. Open user's project, script Caster.cs
2. In line 33, observe the structure of Raycast
3. Enter Play mode
4. While in Play mode, you can toggle between Raycast maxDistance set and not set

Expected: editor doesn't compile as Raycast has a LayerMask type of object in the float field (check picture attached)
Actual: editor compiles and somehow still manages to cast a Ray with a maxDistance parameter type of LayerMask (check pictures)

Reproduced in: 5.5.5p2, 5.6.4p4, 2017.1.2p4, 2017.2.0p4, 2017.3.0f1, 2018.1.0a7

Note: any other in maxDistance field inserted different-typed objects were greeted with errors as intended

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.