Quantcast
Channel: Answers by "Downstream"
Browsing latest articles
Browse All 56 View Live

Answer by Downstream

You need to calculate the direction components, normalize them and then add a force to that vector, whose strength is defined by the inverse-square law: var intensity = 5.5f; components =...

View Article



Answer by Downstream

You're rotating it at approximately 3214 degrees per second. :) [That method of the Rotate-command takes two parameters][1], axis and angle. You have the two confused. transform.Rotate(Vector3.left, 45...

View Article

Answer by Downstream

Use transform.RotateAround? You get the position from the object you're rotating around and the axis from one of its facings (i.e. transform.forward)....

View Article

Answer by Downstream

Well I just solved my own problem by reimporting with: AssetDatabase.ImportAsset(path); (There will be lag.)

View Article

Answer by Downstream

Do you want it to be like skeet shooting? In which case you need to add a rigidbody to your plates, then use Vector3.AddForce(transform.forward * strength) after instantiating. Shooting them could be...

View Article


Answer by Downstream

It works for me.

View Article

Answer by Downstream

Does this answer your question: http://answers.unity3d.com/questions/585035/lookat-2d-equivalent-.html

View Article

Answer by Downstream

I think you're not supposed to increment individual variables of a transform position. C# gives an error if you try to do that. Try increment transform.position with another Vector3.

View Article


Answer by Downstream

Raycast works by taking a vector from a position and checking if there's a collider in the path of that vector, basically like a bullet. You can then use the data in the raycasthit variable type to do...

View Article


Answer by Downstream

So I used ILSpy to open UnityEditor.dll and found the method the editor uses: UnityEditor.ImportRawHeightmap -> ReadRaw Hopefully I can adapt this for use at runtime..

View Article

Answer by Downstream

So I used ILSpy to open UnityEditor.dll and found the method the editor uses: UnityEditor.ImportRawHeightmap -> ReadRaw Hopefully I can adapt this for use at runtime..

View Article

Answer by Downstream

Sorry, I didn't check my reference answers. To do that, transform.LookAt also takes a plain Vector3 as the first argument, then you need to set the y-value of that vector3 to equal the height, y, of...

View Article

Answer by Downstream

I would suggest you go view the live training or basic tutorials first. This sort of task will be trivial to anyone who's viewed them. Basically you want a script with an update function that takes the...

View Article


Answer by Downstream

@uveritegames Well this code works fine for me, and it shows whether I hit anything in the scene view (be sure to change the tag name). using UnityEngine; using System.Collections; public class...

View Article

Answer by Downstream

Here's a script for getting started. using UnityEngine; public class RayCaster : MonoBehaviour{ public int answer = 4; int numstart; public void Start(){ numstart = (int)KeyCode.Alpha0; } bool...

View Article


Answer by Downstream

/*@iubisoft Basically you have to calculate the angular velocity of the planet and the angular velocity of the ship in relation to the planet. Here's my test script which I used to calculate it. It's...

View Article

Answer by Downstream

@zak666 You're using == on line 46. It's a comparison operator, it doesn't set the value. Whenever something basically ends up "orphaned" in the script it returns this error, here you have a lone...

View Article


Answer by Downstream

@F14M3THR0W3R Seems like you have rigidbodies on your wheels or something if they fly off. You only need a rigidbody on the parent car object. There was a long post about cars and stability somewhere,...

View Article

Answer by Downstream

@jevans70 An empty scene is about 6kB so I suppose that's how much you'd save not using scenes. I wouldn't invest the effort into saving that, keeping in mind how much scenes can help with organizing...

View Article

Answer by Downstream

@OcDGamer98 It seems specific to your GPU, I noticed another question where you were talking. It's best to submit an issue via the tracker.

View Article

Answer by Downstream

@False-Wall @NotQuiteDead It seems specific to your GPU. It's best to submit an issue via the tracker. The more of you do it the more important, I suppose, the issue will be ranked.

View Article


Answer by Downstream

@zak666 You cannot multiply a transform with a number. What are you doing on line 62. this.transform.position = Gunposision * ReloadSpeed * Time.deltaTime; //Vector3 = Transform * float * float...

View Article


Answer by Downstream

@sith4life When dealing with a problem such as this where the null reference is elusive just log everything out one by one. Players, playerIndex and destinationTile. The only thing that can be null in...

View Article

Answer by Downstream

@CasperLIHongKong Renderer.material.mainTexture can be used to change it, I believe. See the documentation on materials and shaders if it doesn't work.

View Article

Answer by Downstream

Do you have TheGameManager component on the same object? GetComponent() gets from the same gameobject this script is attached to.

View Article


Answer by Downstream

@Tom01098 Why are you using Lerp instead of something that is actually constant when changing the start and end position? For example `monster.position += (player.position -...

View Article

Answer by Downstream

@Sendatsu_Yoshimitsu It's trigonometry. Assuming your heading is from up 0, right 90 degrees. You need the sin and cos functions x = Mathf.Sin(angle * Mathf.Deg2Rad), y = Mathf.Cos(angle *...

View Article

Answer by Downstream

KeyCode enum has: `Mouse0 The Left (or primary) mouse button.` `Mouse1 Right mouse button (or secondary mouse button).` `Mouse2 Middle mouse button (or third button).` `Mouse3 Additional (fourth) mouse...

View Article

Answer by Downstream

@uhh_ryan Set the mask of the camera? You set the layer of the objects to "screen" in the inspector. ![alt text][1] [1]: https://i.imgur.com/RCqA97B.png

View Article


Browsing latest articles
Browse All 56 View Live


Latest Images