I need a little help fixing "parameters do not match signature". Looking at other fixes:
I've tried changing
local arg = util.TableToArray({player.eyes:HeadRay()})
to
local position = player.transform.position
local arg = util.TableToArray({position, UnityEngine.Vector3.get_forward()})
which resolves the error, but the loop no longer finds the building the players is looking at. I suspect the problem is with the get_forward?
Thanks.
Solved UnityEngine.Physics.RaycastAll["methodarray"] signature matching
Discussion in 'Rust Development' started by insane8472, Sep 19, 2015.
-
Wulf Community Admin
The problem is with the methodarray you were using before, which was changed in the Unity 5.2 update. They added/changed some, so you'd need to loop through it to find the correct one.
-
Thank you. Hate to ask, could you please provide an example or anything willing. The solution still evades me despite what I have tried.
-
Wulf Community Admin
-
Thanks. Hopefully he chimes in.
-
-
This is what I was using:
Code:local arg = util.TableToArray({player.eyes:HeadRay()}) local hits = UnityEngine.Physics.RaycastAll["methodarray"][1]:Invoke(nil,arg) local it = hits:GetEnumerator() while it:MoveNext() do if it.Current.collider:GetComponentInParent(global.BuildingBlock._type) then local buildingblock = it.Current.collider:GetComponentInParent(global.BuildingBlock._type) if buildingblock then do stuff end end end
-
Switch out the methodarray index 1 for index 2
Code:UnityEngine.Physics.RaycastAll["methodarray"][2]
-
Thank you, Mughisi, as always.
While on this subject, would you be able to assist me in my other topic with getting code lock code/owner of door? Thanks.
Last edited by a moderator: Sep 21, 2015