First of all, this is my very first experience with gamedevelopment. I am a developer during the day and now i want to experiment some with gamedevelopment.
Unity 3D looks cool. I have read documentation and watch some tutorial video’s and now i started on my own very simple project.
THis is what i have done:
I have create a plane and put a texture on in.
I created a cube gameObject that i will use as my “character” were the user plays with.
created an empty gameObject and added the Character controller
put my cube as a childobject under the gameObject (both centers are aligned)
5)Put the combine children script on my object
put the default FPSWalker script on it.
I tested this and i can move my cube whitch i thought was nice
I put some more cubes on my plane that i have called walls. THe interaction with those walls are good. When my cube collide with it, my cube stops witch is great.
But then, the actual question… I have created another cube gameObject were i have added the Rigidbody component. Mass 0,1 Drag 0 is Kinematic is off. THe box collide is there and has isTrigger off.
I thought when my cube collides with that smaller cube, that smaller cube would move but my character just stops as it would collide into a normal wall.
Do i have to create my own script that would move the smalller cube on collition or can i use the physics engine from unity?
I hope i gave enough information so you guys could help me…
As far as I understand, yes. I tried the same thing when I first got my hands on Unity. In fact, I made a tower of a whole bunch of small objects and tried to roll a big ball to knock them down.
Only one object needs a rigid body the rest do not…so Increase the mass on your controlled player Object and then the other smaller object should move correctly when you hit it…I Hope that does it for you if not just drop another message and I will en devour to get you up and colliding in no time…
A character controller does not have a mass property? You can’t add a rigidbody to a gameObject that has a character controller on it, right? So how do i increase the mass of my character?
Does size also matter? For example if my char has a mass of 40 and my box a mass of 1 but it is bigger, what happens then?
I believed i tried adding a rigidBody to my character but than he starts to act funny… My cube turns and twists around the x and y axis.
Just a thought…
My character is a parent gameObject and the cube is the child of the character controller. Does the parent also need a box collide or is enough that their is a box collide on my child (cube)?
Could this be what causing my 2 cubes not to interact?
Ah… that makes sence… So instead i should use a RigidBody to have realistic physics and interaction with other colliders?
But the default script i use FPSWalker uses a characterController if i am not mistaken… If i would use a rigidBody instead, that doesn;t work.
I also read somewere that you can’t have both a rigidbody and a charactercontroller so will i have to do the scripting for th movement myself or is their a default script for rigidBody?
Sounds maybe new questions but i am just exploring Unity. I also found that their are no tutorials explaining how to create a simple character and let it move, interact and so on. All the tutorials come with scripts that aren’t that well explained witch is not so great actualy…
I checked it out and that character realy does have a charactercontroller on it
So i guess the collision is scripted then on that example?
It’s a pitty the scripts are not really that well explained. The complete tutorial is already scripted and all we have to do is just drag and drop some assets and script from the project view. I checked yesterday to see what’s the difference between my setup and the Lerpz project but beside the scripting i couldn’t find anything strange.
It would have been a great tutorial if it only added the textures and models but nothing on the scene and no script so we have to do everything ourselves. This would be better because if you start from scratch and do it yourself you know much better how everything works.
(maybe i am a bit negative here but just to make it clear, i realy like the power of unity and i want to make an efford to get to know it really wel, that’s why i start with the very basisc…)
Perhaps someone can explain me the steps needed to create a cube witch i use as a character so it can interact with other “boxes”. This would be very helpfull!