I’m checking the new 2D features in Unity 4.3 edition. So they changed some components to work now with 2D environment. I’m using Physics2D.Linecast to check if player is on the ground. But everywhere my char stay on ground, even if it’s jumping. My ground is marked as ground to get correct layer to compare char vector with the ground’s one.
grounded = Physics2D.Linecast(transform.position, groundCheck.position, 1 << LayerMask.NameToLayer("Ground"));
- “grounded” is a bool to check if player is on the ground;
- “transform” refers player’s transform;
- “groundCheck” is an emptyObject put into player to mark ground directions.
Since I’m using the new resources, probably raycast or “old” components to handle 3D environments can’t help me there.
Thanks in advance and sorry about my english.
Here is an article I found which explains how to use Physics.OverlapCircle to check if object is grounded. Maybe it might help someone who is struggling to get this [Check Object Grounded][1] [1]: http://www.thegamecontriver.com/2014/11/check-if-object-character-is-grounded.html
– falconerYou should take a look at [this][1] [1]: http://answers.unity3d.com/questions/920023/change-materials-emission-scale-at-runtime.html here is the code snippet pulled straight from that page: DynamicGI.SetEmissive(renderer, new Color(1f, 0.1f, 0.5f, 1.0f) * intensity) and in this case, you change the value of "intensity" to be equal to volume * rmsValue that should do it I believe, haven't tested the code though, so let me know if it worked
– MasterGalaxy