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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer by jamesflowerdew
public string pLevel; void Update(){ if(Input.GetKey(KeyCode.enter)){ Application.LoadLevel(pLevel); } }
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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