Quantcast
Channel: Answers by "Peter G"
Browsing all 90 articles
Browse latest View live
↧

Answer by Peter G

The general equation for linear interpolation is your second one. Output = (1 - t) * Input1 + t * Input2 It can nicely be expanded to higher degrees (see Bezier curves) and vectorized. Just treat the...

View Article


Answer by Peter G

From my experience, you actually have to get the particles before you can set them. Not every frame, but at least once you need to get some existing particles before you change them and reassign them....

View Article


Answer by Peter G

You really shouldn't compare floats this way, but the comparison operator is two equal signs: if (StackNum == 1) { }

View Article

Answer by Peter G

You should just be able to add the initial value to the result of `Mathf.Repeat()` var answer = 50f + Mathf.Repeat( Time.time * TimeMultiplier , 50);

View Article

Answer by Peter G

I see what you're trying to do, and it could work. It just seems like a rather circuitous way of doing it. I might try something like this. Vector3 offset = target.position - transform.position;...

View Article


Answer by Peter G

Moving a character to a point is the same process as moving value to a destination. You find the direction then move in that direction until the offset is less than a specified precision. void Update...

View Article

Answer by Peter G

I would do something like this: var scoreMultiplier = 5; function Start () { InvokeRepeating( "DecreaseMultiplier", 30 , 30); //You could easily set this up as a coroutine if you wanted variable times....

View Article

Answer by Peter G

You have 2 errors. It looks like you are trying to call the constructor to create a new Vector3. The issues is that there are no constructors that take a Vector3 as an argument (you can copy it, but...

View Article


Answer by Peter G

I'm not totally sure that the design of your program makes sense. Your card class is currently working as both the container class for a card, and the enumeration of all the cards in the player's hand....

View Article


Answer by Peter G

The problem is that a mutual conversion exists. To quote the [MSDN page][1] on your error.> In a conditional statement, you must be able to convert the types on either side of the : operator. Also,...

View Article

Answer by Peter G

There's two errors. One of which is causing the compiler, and the other of which is just causing broken behavior. You have to assign the output of `Mathf.Clamp()` to something. `inAirVelocity` is...

View Article

Answer by Peter G

A draw call is basically a batch of triangles sent to the GPU for drawing. In general every object with a different material creates another draw call (there are ways of combining draw calls, but...

View Article

Answer by Peter G

If I'm understanding your question correctly, you shouldn't need any other variables. Can you do something like this: int minimumWage; int poverty; function Update () { if(minimumWage < poverty/10)...

View Article


Answer by Peter G

If you're accessing `counter` from a member function in the same class that counter is declared in, then you can access it without a type identifier. Otherwise you need to put the class name before you...

View Article

Answer by Peter G

'RED' and 'BLUE' are [instance variables][1] (compare to [class/static variables][2]). You need to find the instance to access there values. The easiest way to do that is: var cube = FindObjectOfType(...

View Article


Answer by Peter G

You shouldn't need to do any uv work. Just some clever texturing. Make a gradient bar then have an alpha cutoff based on how loaded the scene is. See Eric's answer here for a good place to start....

View Article

Answer by Peter G

New folders should work fine

View Article


Answer by Peter G

I don't really use `boo`, but if it's much like C# or js, then you should be able to take out the cast and then it will probably be okay. class scriptEnemy(MonoBehaviour): public tr as Transform = null...

View Article

Answer by Peter G

Try this: var script : PlatformMovement; //This shouldn't be a static variable. function OnTriggerEnter(object : Collider) { if(object.CompareTag("Platform 2") { script =...

View Article

Answer by Peter G

The problem is with the implied delegate [ElapsedEventHandler][1]. Your function `_timer_Elapsed` doesn't fit the signature because it returns an IEnumerator. Now you have two choices how to fix it....

View Article
Browsing all 90 articles
Browse latest View live


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