Quantcast
Channel: Answers by "jamesflowerdew"
Browsing latest articles
Browse All 61 View Live
↧

Answer by jamesflowerdew

Selection.activeGameObject=vWay.gameObject; :)

View Article


Answer by jamesflowerdew

The following may not be the best answer, but it is one answer. This kind of stuff can usually done by sending raw data (although it is more work). You'd save out the data then use this to rebuild the...

View Article


Answer by jamesflowerdew

I've been here I think. at a guess your collider needs to be set to "is trigger" (a checkbox on your collider). at a guess this will negate it's use as a platform which means you'll need another...

View Article

Answer by jamesflowerdew

As above I'd be tempted to apply gravity without the physics pseudocode below: pArrowMomentum+=new Vector(0,MyGravity*Time.deltaTime,0); transform.LookAt(transform.position+pArrowMomentum);...

View Article

Answer by jamesflowerdew

I don't do JavaScript so my grammar may be dodgy, but does this help? function OnCollisionEnter(col:Collision) { print(col.gameObject.name); var vScript: EnemyAI=col.gameObject.GetComponent(EnemyAI);...

View Article


Answer by jamesflowerdew

This uses mouse or finger to generate an force called pPush, which is then applied to a ball. nFrame is Time.deltaTime all other vars with a "p" in front need declared at the top of your script. void...

View Article

Answer by jamesflowerdew

does this help? you can split a string with string slpit so you can just use whatever you like to delimit the item like below, (to and from string). string timertext = ""+...

View Article

Answer by jamesflowerdew

A "splat" mixes two or more textures using data from a third one (or elsewhere). In this case, Splats 1-4 are the textures to be displayed/mixed, and the splatmap has the colours that determine which...

View Article


Answer by jamesflowerdew

I hope this helps. a unity cube is 1m by default. a unity plane is 10m by default. why? I don't know. in 3dsmax, exporting an object that's 1 generic unit long to fbx comes through (set import scale...

View Article


Answer by jamesflowerdew

public string pLevel; void Update(){ if(Input.GetKey(KeyCode.enter)){ Application.LoadLevel(pLevel); } }

View Article

Answer by jamesflowerdew

input on the x and y will be between 1 and -1 depending on the player's actions (0 if they are not touching anything ;)). mutiplying these by set values will convert these actions into movement at in...

View Article

Answer by jamesflowerdew

Hi All, I figured this out finally. I should mention that I got a clue here, albeit not one that I understood:...

View Article

Answer by jamesflowerdew

will this do? this.enabled=false; or Destroy(this);

View Article


Answer by jamesflowerdew

set newIntensity to a default value at the beginning, before any "if"s or "elses". frustratingly unity/c# treats a variable that's only set when it's nested in an "if" statement as undefined for error...

View Article

Answer by jamesflowerdew

you're missing a bracket on your if, and using the wrong symbols to open/close your else... if(Input.GetButtonDown("Sprint")){ } else{ anim.SetBool("Sprint", false); } other errors may disappear when...

View Article


Answer by jamesflowerdew

you need this: renderer.material.SetColor ("_Color", color); dot syntax does not work with materials. also note `"_Color"` is the address of the `_Color` variable in a shader, if your material's shader...

View Article

Answer by jamesflowerdew

float moo= Input.GetAxis ("Vertical"); float meow= Input.GetAxis ("Horizontal"); if(moo!=0){ meow=0; } transform.position+=new Vector3(meow,moo,0);

View Article


Answer by jamesflowerdew

It is or at least should be illegal IMHO to clone games. however, they [are there][1] We started something like this, and got quite far before we decided that we wanted to do our own thing, and not...

View Article

Answer by jamesflowerdew

I think you have a wiggly bracket "}" missing on line 14 you actually have loads of wiggly brackets missing in terms of code understandability imho: a pile of if (whatever) dowhatever(); if...

View Article

Answer by jamesflowerdew

shader "gamevial/gasgiant2" { properties{ _MainTex ("Diffuse", 2D) = "white" {} _RippleTex("Ripple (RGB) Trans (A)", 2D) = "black" {} _Shininess ("Shininess",Float)=10 _OffsetX("UV Offset X",Float)=.5...

View Article

Answer by jamesflowerdew

This might be helpful :) am just writing in the lerp not using mathf, but it works, and as a function . Rect LerpRect(Rect nRect1, Rect nRect2,float nNum){ Rect vRect=nRect1;...

View Article


Answer by jamesflowerdew

foreach(KeyCode vKey in System.Enum.GetValues(typeof(KeyCode))){ if(Input.GetKey(vKey)){ //your code here } } :) this detects what key has been pressed. I use it for my custom input manaer.

View Article


Answer by jamesflowerdew

Yes, it's been changed. Cursor.lockState=CursorLockMode.Locked; locks the mouse. Cursor.lockState=CursorLockMode.None; I've forgotten how to hide and show it .

View Article

Answer by jamesflowerdew

There is this, which is, I think, exactly what you were looking for... Shader "gamevial/randomshader" { Properties { _Splat0("Texture1 (R)", 2D) = "white" {} } CGINCLUDE ///reusable stuff here ENDCG...

View Article

Answer by jamesflowerdew

errr... how about "public Texture screenImage;"? or "public Texture2D screenImage;" your texture would have to be read write enabled, but that would work.. also you'd have to compare mouseposition xy...

View Article


Answer by jamesflowerdew

to lerp from grot to a target angle named vRot:: gRot = new Vector3(Mathf.LerpAngle(gRot.x,vRot.x,pFrame),Mathf.LerpAngle(gRot.y,vRot.y,pFrame),Mathf.LerpAngle(gRot.z,vRot.z,pFrame)); works for me :)

View Article

Answer by jamesflowerdew

I don't know a "total answer" (I don't think there is one), but: you can add a test to detect your application/player's location at startup. string vAddress=Application.absoluteURL; string...

View Article

Answer by jamesflowerdew

Above answers both work I agree, but are both kinda wrong in my humble, you CAN swap scripts. but it's quite hard (actually, not that hard come to think of it). You'd GetComponent on one script, and...

View Article
Browsing latest articles
Browse All 61 View Live


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