Timeline for Unity raycast equivalent in Unreal
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 21, 2020 at 13:40 | vote | accept | Daniel Marques | ||
| Mar 21, 2020 at 13:40 | comment | added | Daniel Marques | Great idea on "caching" the cast. I've experimented with custom collision but I do want other objects to block the trace, so the solution you presented is correct for me. | |
| Mar 21, 2020 at 13:20 | comment | added | Stephen | @DanielMarques You're correct about the casting. I've edited to show it. To avoid issues with casting and overhead, you can create an AYourCustomActorClass* MyActorReference variable and see if it exists, only casting if it doesn't. As for the layer thing, if I'm correct then if you're using custom collision, Unreal will ignore other things in front of it and only check if it is colliding with a specific collision setting. | |
| Mar 21, 2020 at 13:17 | history | edited | Stephen | CC BY-SA 4.0 |
added 2 characters in body
|
| Mar 20, 2020 at 17:13 | comment | added | Daniel Marques |
Thank you very much for your answer. Is casting the only way to check if it's the specific actor? Generally casting can be quite taxing, that's why in Unity I would check using the Layer. By the way, isn't the syntax for casting in UE4 Cast<ClassToCast>(myActor)?
|
|
| Mar 20, 2020 at 16:36 | history | answered | Stephen | CC BY-SA 4.0 |