• Unity3D - Discussion
    5,004 replies, posted
[QUOTE=mib999;47310869]That style is really good, other than the trees being lower poly than everything else.. I know you're meant to be low poly but it doesn't correlate with the rest of the objects.[/QUOTE] Alright worked on this today. Kinda lost the super low poly style and it mutated into somewhat lowpolyish but still flat shaded. [IMG]https://i.imgur.com/cKUfpfz.png[/IMG]
Flat shaded with AO looks so cool
[QUOTE=AJ10017;47326073]So i added a gun to my FPS camera, as well as lerped weapon recoil and ballistic bullets [video=youtube;vpIezcsbBy0]http://www.youtube.com/watch?v=vpIezcsbBy0[/video] EDIT: Added iron sights :v: [video=youtube;Pq-VPjWlVDc]http://www.youtube.com/watch?v=Pq-VPjWlVDc[/video][/QUOTE] Wow, this looks awesome! How are you moving the player? I've messed with bog standard translations as well as forces, and both looked and felt lousy.
Why does my model get lit on the edges when it's in shadow? [img]https://dl.dropboxusercontent.com/u/13781308/ShareX/2015-03/2015-03-15_13-53-47.png[/img] [editline]15th March 2015[/editline] This is in 4.6 by the way
specular highlights?
Just a simple diffuse shader [IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2015-03/2015-03-15_14-12-08.png[/IMG] And it shows up on other models too. Same material setup [editline]15th March 2015[/editline] And my light settings [img]https://dl.dropboxusercontent.com/u/13781308/ShareX/2015-03/2015-03-15_14-23-34.png[/img]
[QUOTE=~ZOMG;47327707]Wow, this looks awesome! How are you moving the player? I've messed with bog standard translations as well as forces, and both looked and felt lousy.[/QUOTE] Im just adding impulse force when the movement keys are pressed, but it only applies force if your velocity is under a certain point so that your speed is clamped. I think the headbob really helps though, gives you the illusion that you have legs and you arent just sliding around on the floor this is all im doing for the movement [code] void Update () { OnGround = Physics.Raycast (transform.position, transform.up * -1, 1.8f); Rigidbody rg = GetComponent<Rigidbody> (); if (OnGround) { rg.drag = 5; } else { rg.drag = 0; } transform.eulerAngles = new Vector3 (0, Cam.transform.eulerAngles.y, 0); if (rg.velocity.magnitude < 6*(Input.GetAxis ("Sprint")+1)) { if(OnGround){ rg.AddForce (transform.forward * Input.GetAxis ("Vertical") * 100, ForceMode.Impulse); rg.AddForce (transform.right * Input.GetAxis ("Horizontal") * 100, ForceMode.Impulse); } else { rg.AddForce (transform.forward * Input.GetAxis ("Vertical") * 10, ForceMode.Impulse); rg.AddForce (transform.right * Input.GetAxis ("Horizontal") * 10, ForceMode.Impulse); } } if (OnGround) { rg.AddForce (transform.up * Input.GetAxis ("Jump") * 200, ForceMode.Impulse); } } [/code] the camera and headbob on another hand is a different story. This could all be simplified a lot as well [code] void Update () { float PitchDiff; float YawDiff; GameObject Parent = GameObject.Find ("Player"); Rigidbody rg = Parent.GetComponent<Rigidbody> (); PitchDiff = Mathf.Clamp (Pitch - (Input.GetAxisRaw ("Mouse Y")*Sensitivity),-90,90); YawDiff = Yaw + (Input.GetAxisRaw ("Mouse X")*Sensitivity); if (ply.OnGround) { Vel = Mathf.Lerp (Vel, (Mathf.Sin ((Mathf.Clamp (rg.velocity.magnitude, 0, Mathf.Clamp (5 * (Input.GetAxis ("Sprint") + 1f), 0, 7.5f)) * (Time.renderedFrameCount)) / 50) * ( 3* (Input.GetAxis ("Sprint") + 1))) + 0.35f, 0.007f); Roll = Mathf.Lerp (Roll,Input.GetAxis ("Horizontal")*-5.0f,0.1f); } transform.eulerAngles = new Vector3 (PitchDiff, YawDiff, Roll); transform.localPosition = new Vector3 (0,Vel, 0); //transform.rotation = Quaternion.AngleAxis (YawDiff, Vector3.up); Yaw = YawDiff + PunchYaw; Pitch = PitchDiff - PunchPitch; PunchPitch = Mathf.Lerp (PunchPitch, 0.0f, 0.1f); PunchYaw = Mathf.Lerp (PunchYaw, 0.0f, 0.1f); } void recoil(float rec){ PunchPitch = rec; PunchYaw = (Random.value - 0.5f) * 2 * rec; } [/code]
Whenever I open my C# project through Unity (double clicking a script), Visual Studio (VS2013) also loads a web tab with the Scripting API Website. How do I disable this feature? [img]http://i.imgur.com/6ou8qMK.png[/img]
Any reasons why there are no default packages in there anymore? [url=http://i.imgur.com/DcT3Yh6.png][img]http://i.imgur.com/DcT3Yh6l.jpg[/img][/url]
Is there any good way to create simple 3D levels (Just floors, walls, stairs really) other than creating planes everywhere ?
[QUOTE=Fleskhjerta;47330767]Is there any good way to create simple 3D levels (Just floors, walls, stairs really) other than creating planes everywhere ?[/QUOTE] Look into Probuilder, part of the Procore 3D plugin It's like a quick whiteboxing tool
[QUOTE=BoowmanTech;47329892]Any reasons why there are no default packages in there anymore? [URL="http://i.imgur.com/DcT3Yh6.png"][IMG]http://i.imgur.com/DcT3Yh6l.jpg[/IMG][/URL][/QUOTE] You have to download and install the Standard Assets separately from their website in order to use them. The main installer doesn't come with them anymore. [QUOTE=Fleskhjerta;47330767]Is there any good way to create simple 3D levels (Just floors, walls, stairs really) other than creating planes everywhere ?[/QUOTE] There's Prototype which is free but rather limited with what you can do in terms of texturing. ProBuilder 2 is great for that however.
[QUOTE=Pelf;47328183]Why does my model get lit on the edges when it's in shadow? [IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2015-03/2015-03-15_13-53-47.png[/IMG] [editline]15th March 2015[/editline] This is in 4.6 by the way[/QUOTE] Anyone? I tried messing with the shadow quality settings but none of it had an effect. And I'm not using any fancy materials, it's just a diffuse Also, How do I disable a Component without knowing it's type? [code]Component targetComponent = this.GetComponent( someString ); targetComponent.enabled = false; // This doesn't work[/code] This doesn't work because Component doesn't have a .enabled property, only the types that derive from it, so for example MeshRenderer.enabled, Collider.enabled, but not Component.enabled
[CODE]MonoBehaviour targetComponent = this.GetComponent(someString) as MonoBehaviour; targetComponent.enabled = false;[/CODE] Better to work with generics instead of strings though.
[QUOTE=Pelf;47328183]Why does my model get lit on the edges when it's in shadow? [img]https://dl.dropboxusercontent.com/u/13781308/ShareX/2015-03/2015-03-15_13-53-47.png[/img] [editline]15th March 2015[/editline] This is in 4.6 by the way[/QUOTE] It's been happening since forever. Unity's shadows aren't the best. I think it has to do with the shadow bias because you can reduce that effect by playing with those settings, but I haven't found a way to completely fix it. It's probably a problem with Unity's rendering that Unity has to fix.
[QUOTE=Jaxe42;47333337][CODE]MonoBehaviour targetComponent = this.GetComponent(someString) as MonoBehaviour; targetComponent.enabled = false;[/CODE] Better to work with generics instead of strings though.[/QUOTE] but Colliders and MeshRenderers inherit from Component, not MonoBehaviour. And I need to work with strings because it's for a trigger system so I just enter a string for the component type and it gets the component using the string. I think I found a workaround though. Lets say I want a mesh to disappear when you touch it, I just put the mesh in a different gameobject and then disable that gameobject using the trigger, instead of trying to fuck around disabling Components.
Because they each have their own implementation (not inherited) you have to check for each possible type, eg if (targetComponent is Collider) (targetComponent as Collider).enabled = false; if (targetComponent is Behaviour) will catch most things.
[QUOTE=Jaxe42;47333746]Because they each have their own implementation (not inherited) you have to check for each possible type, eg if (targetComponent is Collider) (targetComponent as Collider).enabled = false; if (targetComponent is Behaviour) will catch most things.[/QUOTE] Yeah, according to the documentation it's MonoBehaviour > Behaviour > Component > Object and Collider, MeshRenderer, ParticleSystem, Rigidbody all inherit from Component. It's annoying because Component has no way to enable or disable, so you have to know/check what type of component it is and use that implementation's .enabled [editline]16th March 2015[/editline] actually, that makes sense because some components like Transform and Rigidbody shouldn't be disabled ever
I think Behaviour, Collider, and Renderer covers almost everything that can be enabled.
This is Unity thread and I need some help..., how do I store PNG images in androids APK uncompressed (I mean, I want Unity to export images as PNG and then import them at runtime (compress and load into memory)... Is this possible? Because currently my APK is too big (80mb)
[QUOTE=Fourier;47334414]This is Unity thread and I need some help..., how do I store PNG images in androids APK uncompressed (I mean, I want Unity to export images as PNG and then import them at runtime (compress and load into memory)... Is this possible? Because currently my APK is too big (80mb)[/QUOTE] I'm sure there are other ways, but the first thing that came to mind was downloading asset bundles after the APK is installed. For reference: [url]http://docs.unity3d.com/ScriptReference/AssetBundle.html[/url]
[QUOTE=LuaChobo;47317486]just got a call from nintendo america they accepted my application to their dev program that i sent nearly 12 months ago dev kit on my wayyyyyyyyyyyyyyyyyy[/QUOTE] christ, it took you THAT LONG? I sent in an app in like, mid-september as a student for educational use so I hope they accept me as well. did they talk to you about the devkit situation?
Could someone tell me what I've messed up here? I can't quite get my head around what's happening. [code] void Awake() { playerRB = GetComponent<Rigidbody>(); playerRB.useGravity = false; } void FixedUpdate() { if(grounded) { inputVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); //vector created purely off of WASD input inputVector = Vector3.Normalize(inputVector); //changes inputVector to a magnitude of 1 if(Input.GetAxis("Horizontal") + Input.GetAxis("Vertical") != 0) { lookVector = Quaternion.AngleAxis(chestPoint.eulerAngles.y, Vector3.up) * inputVector; forwardDir = Quaternion.LookRotation(lookVector, Vector3.up); playerModel.rotation = Quaternion.Lerp(playerModel.rotation, forwardDir, Time.deltaTime * rotateSpeed); } targetVelocity = Quaternion.AngleAxis(playerModel.eulerAngles.y, Vector3.up) * inputVector * playerSpeed; //rotates inputVector by playermodel rotation (so you move relative the way you're facing) changeVelocity = targetVelocity - playerRB.velocity; //calculates difference in target velocity and current velocity if(changeVelocity.magnitude > maxVelocityChange) //makes sure velocity difference isn't bigger than maxVelocityChange to limit acceleration { changeVelocity = Vector3.Normalize(changeVelocity) * maxVelocityChange; //resizes difference to max, maintaining direction } playerRB.AddForce(changeVelocity, ForceMode.VelocityChange); //applies force to rigidbody } playerRB.AddForce(new Vector3 (0, -gravity * playerRB.mass, 0)); grounded = false; print ("Speed: " + Vector3.Magnitude(playerRB.velocity)); } void OnCollisionStay() { grounded = true; } } [/code] It's a third person character controller. Essentially what's supposed to happen is the character's rotation lerps towards the camera direction (which is actually the rotation of an empty that rotates based off of mouse movement, that has a camera parented to it), and the player moves in the direction the player is facing. What's happening, however, is that the inputs are essentially being doubled. Pressing S will move forwards, W+D will move the right, D will move backwards, and I can't understand what's going on.
so ive been working on a weapon base script that i can apply to any object to make it shoot. i added bullet count just now so you can make shotguns [video=youtube;jiCtWYA0OCE]http://www.youtube.com/watch?v=jiCtWYA0OCE[/video] heres a list of customizable options for it so far. I plan to add identifiers to it so it tells the player script what weapon is equiped [code] -spread (X,Y independent) -recoil (X,Y independent) -fire delay -automatic or semi automatic -aim down sight speed -iron sight position -bloom (recoil and spread the weapon accumulates over time) -bloom decay (when the bloom resets) -max bloom (clamp the bloom after a certain number of shots) -clipsize (does nothing yet, but it is obvious what it will do) -view recoil (how much the view entity is bounced around) -sprint angles -sprint position -sound overlap bool (do not overwrite current playing sound) -sprint lower (disable the sprint effects for this weapon) [/code] and heres an older video [quote][video=youtube;9n0acUmiLhg]http://www.youtube.com/watch?v=9n0acUmiLhg[/video][/quote] unity asset download: [URL="https://www.dropbox.com/s/r8j1y7ki5g0ozzn/fpscharacter.unitypackage?dl=0"]dropbox.com[/URL] includes the player prefab, scripts for the player movement, scripts for the player camera, bullet prefab and the bullet script notes: -bullet entities need to have a box collider size of 0.001 if you intend to use more than 1 bullet, and the rigidbody collision type needs to be continuous dynamic -you may need to create your own character prefab. I cannot remove the box from the player because the child gameobject dissapeared from the parent for some reason EDIT: Updated the package with cleaned up code so that using custom models is way easier
[QUOTE=foszor;47336650]I'm sure there are other ways, but the first thing that came to mind was downloading asset bundles after the APK is installed. For reference: [url]http://docs.unity3d.com/ScriptReference/AssetBundle.html[/url][/QUOTE] I know for that one :P, it is just that I want to really squeeze packet.
I don't post in here at all but I figured I should post this here as well. [url]http://bedroomproducersblog.com/2015/03/12/sonniss-free-game-sounds/[/url] I posted this in the programming WAYWO and UE4 thread already. This includes 10GB of free royalty free sound which hopefully you all will find invaluable.
oh god...And i bought fx sound thing :(
[QUOTE=LuaChobo;47317486]just got a call from nintendo america they accepted my application to their dev program that i sent nearly 12 months ago dev kit on my wayyyyyyyyyyyyyyyyyy[/QUOTE] a year? jeez, i've been waiting 8 months, i've heard some other people say they waited 6. I thought i was forgotten about after that but i guess i just gotta wait some more.
Just spent an hour doing physics and writing an algorithm for leading a target but it's so good that it can't hit the player because it can't account for gravitational acceleration on the lander. Not yet anyway. :v: I might finally have to get around to tapping into my trajectory previewer to pull out future positions.
I just started trying to get to know Unity for the first time and now I FINALLY have something to use my university's free web space for [URL]http://www.unf.edu/~n00912194/[/URL]
Sorry, you need to Log In to post a reply to this thread.