Answer 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 ArticleAnswer 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 Article