Answer by diegzumillo
I haven't tested this but it should work. Use the hierarchy system. Use this lookat function on one object to give the orientation you want, then create another object as a child of this one and...
View ArticleAnswer by diegzumillo
Excuse me if this sounds like a silly question, but did you attach the script to your character? just drag it to your character (it's an honest mistake if you're really just starting) Also, you need an...
View ArticleAnswer by diegzumillo
Oh, rigidbody gravity. In that case, avoid translate(). In order to work with a rigidbody you should use forces to control the character. Another solution, usually frowned upon, is to alter the...
View ArticleAnswer by diegzumillo
Do you want it to be instantaneous or continuously moving? Either way there is a number of ways to do it. Instantaneous you can do simply like this: if(Input.GetButtonDown("Jump")){...
View ArticleAnswer by diegzumillo
I just made a quick test here and didn't find anything wrong with physics2d for objects below y=-10. They hit some obstacles and continued falling for thousands of distance units. Take a look at your...
View ArticleAnswer by diegzumillo
It depends on how you're moving it. The transform.Translate() function will definitely cause problems, but changing the rigidbody.velocity directly **seems** to be safe. I can't tell you with 100%...
View ArticleAnswer by diegzumillo
Instead of using "Target.position" you could simply create a new vector like: var LookHere : Vector3 = Vector3(Target.position.x, transform.position.y Target.position.z); and use it on your lookat...
View ArticleAnswer by diegzumillo
There is a number of ways to achieve what you want. My suggestion is to make the wheel the child of some other game object. Then you only apply the velocity dependent rotation to the wheel, and the...
View ArticleAnswer by diegzumillo
Before positining the camera do a raycast call, and if it hits something position the camera a little before this point. A schematic view of this code: var distance : float; //distance of camera from...
View ArticleAnswer by diegzumillo
If I understand what you are describing, this is the intended behavior of a physics object. Jumping higher would be like creating energy from thin air :) My suggestion is: don't use a bouncy material!...
View ArticleAnswer by diegzumillo
Easiest way to do that is to define a new variable like Vector3( Vector3.forward.x, 0, Vector3.forward.z); That, however, will have limited uses, as you may want it to move in y occasionally. A little...
View ArticleAnswer by diegzumillo
Use Time.deltaTime instead of Time.time :) (you might need to tweak your rotatespeed)
View ArticleAnswer by diegzumillo
I don't know what is the best approach here, but you can have the username stored in the playerprefs, so it's accessible on all scenes. You can also store this and whatever other information you find...
View ArticleAnswer by diegzumillo
You need to use Vector2 as arguments for the Physics2D.Linecast. I made the same mistake when migrating to 2D physics :P Something like var MyPos : Vector2 = Vector2(transform.position.x,...
View ArticleAnswer by diegzumillo
The normals seem to be inverted (if you position the unity camera inside the cockpit it should invert the effect, the invisible part becomes visible and vice versa). I don't know how you made this...
View ArticleAnswer by diegzumillo
I'm a javascript user but, at the end of your triangles definition you have "7[};][1]" that looks odd. Try int[] triangles = new int[] { 0, 1, 2, 2, 3, 0, 1, 5, 6, 6, 2, 1, 3, 2, 6, 6, 7, 3, 4, 5, 1,...
View ArticleAnswer by diegzumillo
1. Go to Edit > Render Settings and you'll find the ambient light color field. 2. You can simply add the object to the hierarchy of your player character in the scene 1. It will only carry over to...
View ArticleAnswer by diegzumillo
That seems like bad normals. I don't know how Blender render things in the viewports but some softwares ignore normals and render both sides of every polygon, that's would be why it looks right inside...
View ArticleAnswer by diegzumillo
If I get what you're asking this is a simple task. You want the angle between the direction the first cube is looking and the position of the other cube? Then it's something like Vector3.AngleBetween(...
View ArticleAnswer by diegzumillo
Translate() and rigidbodies don't go well together, and I assume the first script is on a game object with a rigidbody component. The physics simulation is fighting your translation and that causes the...
View Article