c# - The type or namespace name not found -
i have code write in c# use in unity5 because old version of unity have little problem.
error cs0246: type or namespace name `collider' not found. missing using directive or assembly reference?
code
vector3 worldposition = getcomponent<collider>().bounds.center + vector3.up * collider.bounds.size.y * 0.5f;
if want perspective of code here.
the error telling you not have type or namespace called collider
within solution.
i noticed pastebin solution using typeof(collider)
. therefore think type collider
not collider
.
also may need instance of object in order use properties:
collider collider = getcomponent<collider>();
then can use collider
object access properties size , center.
Comments
Post a Comment