Answers for "how to make an object float with physics unity"

C#
1

unity float from another gameobject

// If your script is monobehaviour:

// You can use
GetComponent<ScriptName>().yourfloat
// if the script is on the same object as your other script.

  
// Or find the object first with a tag using
GameObject.FindWithTag("yourobject")
// and then do
.GetComponent<ScriptName>().yourfloat

// if your script is not monobehaviour you will have to make a new instance like

 yourscript script = new yourscript();
 script.yourfloat

// or make your float value static and you can do yourscript.yourfloat without making a new instance.
Posted by: Guest on July-11-2021
-1

how to make float in unity c#

public float number = 5;
Posted by: Guest on March-07-2021

Code answers related to "how to make an object float with physics unity"

C# Answers by Framework

Browse Popular Code Answers by Language