Answer by diegzumillo
You could identify the colors with the materials assigned. A simple trace from the camera in the viewing direction would hit the object and you can easily find out (material name, maybe, but a tag...
View ArticleAnswer by diegzumillo
**IF** I understood your question, here's how I would do this: Create a dummy object, let's call it 'root'. As a child of this root I would assign a camera and, maybe, a model for the player, but let's...
View ArticleAnswer by diegzumillo
The function PlayerPrefs.GetInt takes only one parameter: the key. You're probably confusing it with setint, which takes two parameters: key and the value you want to set this particular key. There is...
View ArticleAnswer 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 ArticleAnswer by diegzumillo
You are probably going to use [dontdestroyonload][1] on the player or some other object. It doesn't have to be the player but some gameobject must survive the level transition with the necessary...
View ArticleAnswer by diegzumillo
You are setting the initial value of *number* to 11. The while loop runs when *number* is snaller than 10, so it doesn't run a single time, thus *number* retains its original value.
View ArticleAnswer by diegzumillo
There are only 10 shapes, so your for loop should be up tp 10, not 20. Also, you want shape[j].dotarray =new Vector3[20]; You already initialized shape in a previous line, inside the for loop you want...
View ArticleAnswer by diegzumillo
To change the parent of something simply change the variable transform.parent. You can assign any gameobject to that variable. Raycasting is one way to go, if you don't have the card/gameobject...
View ArticleAnswer by diegzumillo
It's hard to diagnose by looking at a video and reading description. Physics problems are always tricky. Here's a general rule of thumb: Scale matters. And I noticed you have a loooooong ass tunnel...
View ArticleAnswer by diegzumillo
One way of doing this is to have whatever script is managing these instantiations to keep a list of references of these objects. I don't know if these objects are being generated all at once at startup...
View ArticleAnswer by diegzumillo
Five years later I return to this project with an answer to this question. Just in case someone following is still interested in this or someone googles this question, here's what I found. I don't know...
View Article