• Unity3D - Discussion
    5,004 replies, posted
Raytrace from both sides, and you should get two 3D vectors :D?
[QUOTE=acds;44361667]Anyone knows how to get the depth of a mesh/collider along a vector?.[/QUOTE] [IMG]http://i.imgur.com/tN7XCWO.png[/IMG]
-snip-
-snip- dumb
[QUOTE=HeatPipe;44361969]Raytrace from both sides, and you should get two 3D vectors :D?[/QUOTE] [QUOTE=z-machine;44362365][IMG]http://i.imgur.com/tN7XCWO.png[/IMG][/QUOTE] Thanks, that's a good idea (also a step easier than getting the horizontal thickness first like I was thinking of doing).
I have a problem with bleeding pixels on android. This is how it acts normally. As you can see it moves the grid with changing velocity and positions [img]http://puu.sh/7Lz6r.jpg[/img] I'm using one pixel for debugging. I'm reading a pixel from a texture, outputting it, reading the pixels to a texture which is then used in the next pass again. The velocity texture should stay like this, one red pixel. This is in the editor and it works fine. [img]http://puu.sh/7Lzdc.jpg[/img] However, on my android. The velocity texture doesn't stay like this. The pixel bleeds to its neighbours untill it fills the texture with red (fitting color). I'm suspecting some wrong uv readings but honestly I have no idea.
Whats the correct way of inheritance in Unity? I currently have: Agent.cs [csharp] public abstract class Agent : MonoBehaviour { protected List<Vector3> nodesToVisit; void Start () { nodesToVisit = new List<Vector3>(); //Init stuff } // Update is called once per frame void Update () { //Update stuff } void OnRenderObject() { //Do some GL drawing stuff } public void NextMove() { nodesToVisit.Add (GetNewAgentPosition()); } protected abstract Vector3 GetNewAgentPosition (); } [/csharp] Then RandomAgent.cs: [csharp] public class RandomAgent : Agent { protected override Vector3 GetNewAgentPosition() { //return random vector3 } } [/csharp] Which I apply to a Agent gameObject But whenever NextMove() is called it troughs a NullReference exception, Im assuming this is because the Agent class Start isnt being called, but I even tried having a Start() Update() and OnRenderObject() in the RandomAgent class that just calls its base class methods and that didnt work either [editline]28th March 2014[/editline] Also how cme I cant do stuff like [csharp]protected List<Vector3> nodesToVisit = new List<Vector3>();[/csharp] directly? It seems to want me to put it in the Start method, this could be because im using prefabs tho Im not sure
[QUOTE=Richy19;44382417]Whats the correct way of inheritance in Unity? [...][/QUOTE] You need to post some error messages. "This doesn't work" doesn't tell us much.
I have narrowed the problem down to this bit of my gui code [csharp] if (GUI.Button(nextTurnSize, "Next Turn")) { foreach(GameObject agent in GameObject.FindGameObjectsWithTag("AgentTag")){ Agent agentClass = agent.GetComponent<Agent>(); //agentClass is always null agentClass.NextMove(); } } [/csharp] I have tried retreiving the RandomAgent component but that doesnt work either, ideally I would like to keep it just getting the Agent component as that way I can just have one lookup rather than having a tag lookup for each differet agent type [editline]28th March 2014[/editline] It definitelly doesnt like something about retreiving base classes as components, I just switched the prefab to use the Agent class instead of the subclass and it worked fine (after making it not abstract) for some reason it doesnt like returning the RandomAgent as a component [editline]28th March 2014[/editline] Ok I figured the issue out, my scene started out with no instances of the prefab, yet for some reason one was created but it seems without the required components. I just added a prefab to the scene so that theirs always one of them there and its fine now
Finally got basic versions of my Light spell working. 2 modes, a pressure sensitive light and a shoot light. Have some GIFs. [IMG]http://uploadir.com/u/ylay6fo9[/IMG] [IMG]http://uploadir.com/u/dccp84rm[/IMG] Really looking for some feedback on this as its for my final year project. How do you guys think I could make it look better? I want to add some sort of light to do the end of the wand, like a particle effect or a glow or something! Also for the shoot spell I want to add in a collider so the light sticks to the first object it touches for like 5 seconds, and during the 5 seconds you can't fire another light. Any thoughts? By the way its my first time in Unity so go gentle please xxx
Wow! Looking excellent, i can't see to much for change, but can you try to ilum the hand a bit more?
Bump Do anyone know why i cant update my fucking unity editor to 4.3.4? The unity editor update says that it failed to connect to the server. This is really important for me.
[QUOTE=Icejjfish;44385542]Bump Do anyone know why i cant update my fucking unity editor to 4.3.4? The unity editor update says that it failed to connect to the server. This is really important for me.[/QUOTE] Uninstall it and install the new one
[QUOTE=gonzalolog;44385252]Wow! Looking excellent, i can't see to much for change, but can you try to ilum the hand a bit more?[/QUOTE] Thanks for the feedback. Do you mean illuminate it when it is glowing or when you shoot a light?
[QUOTE=Over-Run;44384130]Finally got basic versions of my Light spell working. 2 modes, a pressure sensitive light and a shoot light. Have some GIFs. [IMG]http://uploadir.com/u/ylay6fo9[/IMG] [IMG]http://uploadir.com/u/dccp84rm[/IMG] Really looking for some feedback on this as its for my final year project. How do you guys think I could make it look better? I want to add some sort of light to do the end of the wand, like a particle effect or a glow or something! Also for the shoot spell I want to add in a collider so the light sticks to the first object it touches for like 5 seconds, and during the 5 seconds you can't fire another light. Any thoughts? By the way its my first time in Unity so go gentle please xxx[/QUOTE] You could add a particle effects to the shooting lights you cast, rather than having a invisible "light" going through level. Also, bump map would make your level more in-depth detail, but you don't have to worry about that for now (Though it would make things more appealing) How does the puzzle work? From what I can see, the core mechanics is that you can use the light to navigate through pitch black dungeon... Assuming there's some trapdoors or some pitfall? Overall, that looks well done, even if you're new to unity! (I thought you were expert on something like this? lol) Anywhoo, I have a question for any unity server host out there, is there any reason why Unity Asset Server doesn't work quite well in Windows Server 2012, yet it works perfectly on Windows 7/8? I assume it has to do with the operating system setup or compatible issue.
[QUOTE=Skibur;44388521]You could add a particle effects to the shooting lights you cast, rather than having a invisible "light" going through level. Also, bump map would make your level more in-depth detail, but you don't have to worry about that for now (Though it would make things more appealing) How does the puzzle work? From what I can see, the core mechanics is that you can use the light to navigate through pitch black dungeon... Assuming there's some trapdoors or some pitfall? Overall, that looks well done, even if you're new to unity! (I thought you were expert on something like this? lol) [/QUOTE] Yeah I do plan to add particle effects eventually when I figure out how to best do it and make it look decent! How exactly do bump maps work? Is that more a texture/modelling side job or is it more code side? And right now there is no puzzle. Basically you will have 4 spells per button, each with a secondary and primary attack, like with this light you can shoot a light or illuminate for a short period. I also plan on having a fire spell and a physics spell to move and push objects, but yeah the plan is to have all the spells working and to make a test level that requires you to use all of the spells to get to the end. Thanks for the feedback, and no I'm not an expert at all ha I am really bad at programming and only started Unity about a month ago.
[QUOTE=Over-Run;44391011] How exactly do bump maps work? Is that more a texture/modelling side job or is it more code side?[/QUOTE] In games, artist or 3d modeler would create a bump map (usually it's called Normal map), which gives texture it's own 3d projection "Depth". I'll see if can provide a gif to show you. It's more of a texturing/modeling side job.
[QUOTE=Skibur;44391090]In games, artist or 3d modeler would create a bump map (usually it's called Normal map), which gives texture it's own 3d projection "Depth". I'll see if can provide a gif to show you. It's more of a texturing/modeling side job.[/QUOTE] Ah I see thanks, I have no experience with that sort of stuff, just got the models off an asset store pack
[QUOTE=Skibur;44391090]In games, artist or 3d modeler would create a bump map (usually it's called Normal map), which gives texture it's own 3d projection "Depth". I'll see if can provide a gif to show you. It's more of a texturing/modeling side job.[/QUOTE] Are they mostly baked from high-poly models or is it more common to create them directly?
[QUOTE=Tamschi;44391795]Are they mostly baked from high-poly models or is it more common to create them directly?[/QUOTE] As far as I know, the standard approach is to bake them from high-poly models.
[QUOTE=Tamschi;44391795]Are they mostly baked from high-poly models or is it more common to create them directly?[/QUOTE] Common practice is bake it from the high poly mesh, then you can add additional normals blend from the texture progarms such as nDo2 or dDo. (legacy dDo is free, take advantage of that if I were you!)
[QUOTE=Richy19;44385640]Uninstall it and install the new one[/QUOTE] I wont lose my game by doing this right?
What's the best way to handle audio? Should I have an audio handler gameobject with all the audio clips that play and then just call a function on a script on it to play a certain clip? Or should everything that plays audio have its own audio source and handle its own audio playing? [QUOTE=Icejjfish;44395189]I wont lose my game by doing this right?[/QUOTE] Nope, it should stay in the directory you created it in
[thumb]http://files.1337upload.net/sssssss-6811f3.png[/thumb] texture coordinates yessss [editline]30th March 2014[/editline] [thumb]http://files.1337upload.net/transparency-162166.png[/thumb] transparency
Dude that's pretty sweet.
-old post snip-
Just a tip, when you use the Unity tags, the link needs to lead to the data file, not the HTML file.
I'm on Unity free, if I want to implement shadow volumes that support more than one shadow casting lights then am I trying to bite more than I can chew? I have no idea how much the free version is limiting me in terms of setting this up, I alreay know that I can't use the stencil buffer but that shouldn't be a huge issue as far as I'm aware.
[thumb]http://files.1337upload.net/normals-d6abd2.png[/thumb] normal maps
[img]http://i.imgur.com/kb3a2tG.png[/img] Wat. Class name is definitely correct.
Sorry, you need to Log In to post a reply to this thread.