Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
193 stars 9 forks source link

Slot to CharacterController cast automatically created but does not work #2989

Closed XDelta closed 3 years ago

XDelta commented 3 years ago

Describe the bug?

Connecting a Slot to a Character Linear Velocity node will automatically create a Slot to CharacterController cast and connect them. As far as I am aware, this cast will always return null.

Relevant issues

None found

To Reproduce

Check description.

Expected behavior

This cast should either effectively act like the Find Character Controller node or otherwise not automatically be connected.

Log Files

No response

Screenshots

image

How often does it happen?

Always

Does the bug persist after restarting Neos?

Yes

Neos Version Number

2021.9.9.1144

What Platforms does this occur on?

Windows, Linux

Link to Reproduction Item/World

No response

Did this work before?

No

If it worked before, on which build?

No response

Additional context

No response

Reporters

Delta#0942

Frooxius commented 3 years ago

This is technically correct behavior. Casts between class types will result in null if the input type cannot be cast into the target one. In this case you're trying to interpret Slot as CharacterController, but since it's not that type it cannot be cast to it. You need to use actual search function for it to find a different object of that type.

It's a bit tricky issue that came before (though I can't find the issues right now). We want to eliminate cases like this where the cast is known to be invalid so it doesn't generate confusing casts, but we also need to make sure that potentially valid casts aren't eliminated by this, since in some cases the cast might actually produce result.

I'll see if I can at least eliminate cases like this for now in the next build.

Frooxius commented 3 years ago

I've added some filtering in 2021.9.11.1001 which should now prevent creating confusing casts like this. Thanks for report!