Jump to content
  • Advertisement

Bubu Bhat

  • Content Count

  • Joined

  • Last visited

Community Reputation

117 Neutral

About Bubu Bhat

  • Rank
  1. I have a character which I've animated using mecanim and some MoCAP Files. The question is ow do you apply some basic physics to this character. As far as I know, animation overrides any default physics of the engine,  Here are 2 things that I tried :   I used almost all sorts of colliders (Box Colliders, RigidBody systems etc..) and added them on my animated character. None helped. I created an empty gameobject and made my character a child of it, now I applied all my collider combinations once again on this gameobject - neither did this work So now the problem is how do I detect collisions of other gameobjects (with rigidbody and box colliders added on them) with this character? And I need to apply gravity on this character somehow? Any idea on how gravity is applied on animated characters?
  2. Bubu Bhat

    Unity Basic Srcipting help in unity

    Attached is a screenshot of my Unity Window with the Cube selected..   [attachment=20560:Untitled.jpg]
  3. Bubu Bhat

    Unity Basic Srcipting help in unity

    Thanks a ton. It's working almost the way I want it to. Added a rigidbody component to the cube and suddenly it began to fall through the terrain, so searched in google and applied a mesh collider  with the 'convex' option ticked, and the cube stayed on the terrain.   Just a small tweak, the game starts with printing the statement: "3D Collision with another object named: Terrain" even tough the y-coordinate of both the player and the terrain are the same. PRoblem is when I collide with the cube, it says nothing.... So I changed the code to void OnCollisionEnter(Collision collision) { if (collision.gameObject.name=="Cube") { Debug.Log("3D Collision with another object named: "+collision.gameObject.name); } } Even this does not output anything upon collision with the cube.. I also tried experimenting with the Collision Detection options - but to no avail   Somehow the cube is not detecting collision, even though I can't directly pass through the cube.
  4. Bubu Bhat

    Unity Basic Srcipting help in unity

    Thanks for all of this.   Just a request: can you kindly give me the full code of the C# file to simply output a message via Debug.Log once my player character collides with a cube in 3D? One such instance of the full code will be of great help. Thanks..
  5. Bubu Bhat

    Unity Basic Srcipting help in unity

    Somehow the Debug.Log function has stopped working, it seems.   I deleted my entire scene, created a very elementary plane and placed a cube (A 3D RIGID BODY) on top of it.   Then I applied the following script on the cube: using UnityEngine; using System.Collections; public class debug : MonoBehaviour { void Example() { Debug.Log("Hello", gameObject); } }  I hoped to see a 'Hello Cube' on my console screen. Well nothing really happened. I have checked  clicking the three buttons on the top right of the console screen - up to no avail.   On another note: Is there a 'beginner' way to print things right on the game window? Like, if you collide with an object a pop-up will display something like: "Game over" etc.  Perhaps then, I can do away with this debug.log not working, this has left me quite frustrated after trying to sort it out for almost a couple of hours by now.. 
  6. Bubu Bhat

    Unity Basic Srcipting help in unity

    Thanks for the help. I'm having some real trouble with scripts. I don't know why, but what I did as an experiment was put a cube and then whenever I collide with the cube, I'd like to display a message..   I wrote this code, applied it to my player character, and yet on collision with the cube nothing happens :( function OnCollisionEnter(theCollision : Collision){ if(theCollision.gameObject.name == "Cube"){ Debug.Log("I hit it"); }else { Debug.Log("Hit the wall"); } }
  7. Hello all,  I'm just beginning to learn unity scripting. I'm trying to implement them as I learn some very basic functions along the way.   This link from unity taught me the basics of OnCollisionEnter() - which, as far as I understand, executes some piece of code whenever it detects collisions with a gameobject (there they named it as prop_powerCube).    Now I tried to implement it in C# and I had something like: using UnityEngine; using System.Collections; public class Mine : MonoBehaviour { // Use this for initialization void Start () { int health=10; } // Update is called once per frame void Update () { //public class DestroyCubes : MonoBehaviour { OnCollisionEnter (Collision col) { if(col.gameObject.name == "Sphere") { //Destroy(col.gameObject); health-=5; } } } Debug.Log("Health=", health); } In short, it would detect collisions with 'Sphere' and decrease the health of the player by 5. The problem I understand is with "col".    It is a variable of type Collison. But how do I explicitly declare it in this case?    MY AIM: WHENEVER MY PLAYER COLLIDES WITH A SPHERE, HIS HEALTH DECREASES BY 5 UNITS.   Please guide me where am I missing it...
  8. I'm just beginning to learn Unity basics. I hardly know languages like C# or Javascript. So I need some help in 'shooting' in unity. Now given, shooting means a huge topic, I'll try to narrow it down to what exactly I need.   I have my Charactercontroller, which can move around forward/backward sideways etc. I learned it from youtube. Now what I want is to get a very basic idea of how EXACTLY AI Shooting works. For e.g. I have a sphere, scaled it appropriately to make it look like a tower etc. Now I want that tower to shoot flames(if possible) at my player character. I'm not going into details of placing guns or barrels etc. No bells and whistles for now.   I tried to learn it from youtube but the problem is most of the videos come with asset sets and models ready. I don't want to use those now. Nothing made by others.   I hope I've made my problem clear...If anyone can help me with a script(with some documentation, if possible), it'd be of great help. 
  9. Bubu Bhat


    I was going through the book 'C programing through game development' and noticed that the mathematical part (calculations etc.) was handled and the processes were explained nicely by the author. However, what i wanted to know was: what language makes up the gaming screen? I mean, C++ calculates the score - fine, but how do we display it in the right hand corner (or wherever we want) of the gaming screen? According to the C++ algorithm, suppose the user loses, how do we display the message to the user on the gaming screen?  More precisely: How do we integrate the programming language that handles the graphics with the .cpp algorithm files ?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!