Question by
muyixuanlin · Jan 28, 2016 at 10:16 AM ·
gameobjectradiuscylinderdimensions
How do you get the radius of your cylinder?
I am trying to get the radius of a cylinder in order to do some calculation.
cylinder = GameObject.Find ("Cylinder");
float radius = cylinder.transform.GetComponent<CapsuleCollider>.radius;
This is what I have, but is doesn't work very well.
Thanks for you help
Comment
What is actually happening when you specify it doesn't work very well? Do you get an error or what? Please shade some light on it.
Your answer
Follow this Question
Related Questions
Unity5/C# beginner here! Need some scripting help :) <3 1 Answer
What are best practices for using GameObjects and public fields? 0 Answers
Destroyed instance of Prefab, can't spawn it back. 1 Answer
Reset rotation of gameobject 1 Answer
How Do I Change UI Image Anchor Position To Hover Over GameObject? 1 Answer