So i have a pretty old version decompiled on my desktop, so i decided to redecompile. Well rust/layers.cs isn't there anymore atleast not that i see is it moved or just gone completely. If so what is the layer to raycast to animals, because what i have isn't working and i think it use to work about a year ago.
EDIT: I ended up doing this maybe there is a better way, but this worked for me.
Code:RaycastHit[] hits; hits = Physics.RaycastAll(player.eyes.position, player.eyes.HeadForward(), 1.0F); for (int i = 0; i < hits.Length; i++) { RaycastHit hit = hits[i]; var horse=hit.GetEntity(); var horsetest=horse.GetComponent<BaseNpc>(); if(horse==null)return; var horsename=horse.ShortPrefabName.ToString(); if(horsename!="horse")return; player.gameObject.GetComponent<Player>().horseentity=horsetest; player.gameObject.GetComponent<Player>().onhorse=true; return; }
Solved Layer for raycasting to animals?
Discussion in 'Rust Development' started by ツンデレラ, Apr 23, 2017.