Quantcast
Channel: Answers by "diegzumillo"
Browsing all 87 articles
Browse latest View live
↧

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


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


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

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

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


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

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

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 Article


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


Answer 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

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 Article

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

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


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

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


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

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


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

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

Answer 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 Article
Browsing all 87 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>