-Snip-
The problem solved it fucking self I guess.
How can I make this fire only once, and then not fire again until you release the button and press it again?
[CODE]function Update () {
if(Input.GetButton("Jump")){
CurrentChapter += 1;
}
}[/CODE]
Pardon if I'm misunderstanding something, but doesn't GetButtonDown do exactly that?
[QUOTE=KillaMaaki;45111466]Pardon if I'm misunderstanding something, but doesn't GetButtonDown do exactly that?[/QUOTE]
That's what I originally put, but then I snipped it because I wasn't sure. But I just looked at the docs, and it is.
Shit. Thanks guys, I spent a little too much time away from Unity.
Worked more on my audio occlusion system. The demo involves a freebie sci fi level from the asset store, and a looping speech made by Dr Breen in the game Half Life 2.
[URL="http://www.mophogames.com/audio-occlusion-wip/"]http://www.mophogames.com/audio-occlusion-wip/[/URL]
Since then I've added the room zones mentioned in the post, and also added support for a third party plugin called AutoVerb so that level designers can automatically calculate reverb settings for each room zone.
[QUOTE=KillaMaaki;45111790]Worked more on my audio occlusion system. The demo involves a freebie sci fi level from the asset store, and a looping speech made by Dr Breen in the game Half Life 2.
[URL="http://www.mophogames.com/audio-occlusion-wip/"]http://www.mophogames.com/audio-occlusion-wip/[/URL]
Since then I've added the room zones mentioned in the post, and also added support for a third party plugin called AutoVerb so that level designers can automatically calculate reverb settings for each room zone.[/QUOTE]
Shared a cabin on the way to denmark with Jory Prum, sound designer behind various games including telltale games. He's a judge on what goes into unity when it comes to sound and we came to the conclusion that unity's sound system is pretty much shit. So projects like these peak my interest.
Keep it up.
Well, it's not complete shit IMHO... but what it is is bare bones.
From the perspective of a sound designer, that basically means it's impossible to do anything beyond the most basic tasks without the involvement of a programmer.
So really, like anything else in Unity, you have to build your own system on top of it. You can do a lot, but not without getting your hands dirty with a lot of scripting.
Luckily that sort of thing is right up my alley :)
It's my first time doing Unity GUI and I managed to get it all working, but the only issue is that elements shift locations depending on screensize and aspect ratio. Can someone in the simplest terms explain to me how I can anchor elements into the exact place I have them?
UnityGUI doesn't have a concept of "anchoring". You're only telling it where to put things, in pixels, relative to the top left corner.
So you have to calculate yourself where you want the elements to be based on Screen.width and Screen.height
[CODE]
function OnGUI () {
GUI.skin = UEPSkin;
if (showHUD == true )
{
//Background HUD Bar
GUI.Box (Rect (0, Screen.height - 20, Screen.width, Screen.height / 10 ), "" );
//Hull Status
GUI.Label (Rect (Screen.width / 128, Screen.height - 20, 100, 20), "Hull: " + Submarine.curhull.ToString() + "/" + Submarine.maxhull.ToString() );
//Weight
GUI.Label (Rect (Screen.width / 16, Screen.height - 20, 100, 20), Submarine.curweight.ToString() + "/" + Submarine.maxweight.ToString() + " Kg" );
//Fuel
GUI.Label (Rect (Screen.width / 9.5, Screen.height - 20, 100, 20), Submarine.curfuel.ToString() + "/" + Submarine.maxfuel.ToString() + " Gal" );
//Fuel
GUI.Label (Rect (Screen.width / 5, Screen.height - 20, 100, 20), "$" + Submarine.playerFunds.ToString() );
if ( modeDeveloper == true )
{
//Coral [ DEV ]
GUI.Label (Rect (Screen.width / 4, Screen.height - 20, 100, 20), "[DEV] Coral: " + Submarine.coral.ToString() );
//Treasure [ DEV ]
GUI.Label (Rect (Screen.width / 3, Screen.height - 20, 100, 20), "[DEV] Treasure: " + Submarine.treasure.ToString() );
}
}
}
[/CODE]
I've done that here, but it still seems to become wonky. Forgive me for not really knowing what I'm doing I've never done this before.
You'll probably be better of with offsets rather than dividing the screen size. Like ( Screen.width - something ) as an offset from the right side of the screen, or ( (Screen.width/2) + something ) as an offset from the middle of the screen.
Update on what I've been working on when able to. Filesize is still a little too large but working on reducing it by around 20mb shortly.
Pre warning then, current file size is ~70mb, music is actually fairly compressed so most of the file size seems to be coming from Daikon Forge.
[unity]http://dl.dropboxusercontent.com/u/10044881/Unity/Cube-E%20Proto%201.2/Cube-E%20Proto%201.2.unity3d[/unity]
Only 3 levels included at the moment, WASD or Arrow Keys for movement. You might encounter a bug where nothing is allowed to move, just hit R to reset the level. A "Best Time" system is in and working but leaving it out for now till I make some adjustments to it.
I take back what I said before about Unity audio.
After hacking away at it today for several hours, I've come to the conclusion that it's an absolute crapnugget.
[QUOTE=KillaMaaki;45121096]I take back what I said before about Unity audio.
After hacking away at it today for several hours, I've come to the conclusion that it's an absolute crapnugget.[/QUOTE]
They're redoing it a bit for Unity 5
[video=youtube;snvVIjAp4dc]http://www.youtube.com/watch?v=snvVIjAp4dc[/video]
- snip, I'm stupid -
[QUOTE=Huabear;45117965]Update on what I've been working on when able to. Filesize is still a little too large but working on reducing it by around 20mb shortly.
Pre warning then, current file size is ~70mb, music is actually fairly compressed so most of the file size seems to be coming from Daikon Forge.
Only 3 levels included at the moment, WASD or Arrow Keys for movement. You might encounter a bug where nothing is allowed to move, just hit R to reset the level. A "Best Time" system is in and working but leaving it out for now till I make some adjustments to it.[/QUOTE]
Can you try to avoid "Activate" 3 blocks at the same time?
[QUOTE=gonzalolog;45128282]Can you try to avoid "Activate" 3 blocks at the same time?[/QUOTE]
Do you mean 3 of the same colour touch leaving 1 remaining? If so I forgot about that possibility and will fix that up
[IMG]http://i.imgur.com/9E7xkg1.gif[/IMG]
This kind of rotation wasn't expected, but it's casting progress :v:
[QUOTE=KillaMaaki;45116243]UnityGUI doesn't have a concept of "anchoring". You're only telling it where to put things, in pixels, relative to the top left corner.
So you have to calculate yourself where you want the elements to be based on Screen.width and Screen.height[/QUOTE] Unless you're using GUILayout, which is a different story.
[QUOTE=Skibur;45144904]Unless you're using GUILayout, which is a different story.[/QUOTE]
Which still doesn't have the concept of anchoring, but unlike regular GUI it calculates layouts for you.
Last question I can't seem to find a good answer to. I'm using Input.GetAxis so the player can bind their own controls, but I also want to flip a mesh based on which way it's going horizontally. I've pretty much tried everything from google and none of them are straightforward enough or they don't work.
[QUOTE=Garrison;45146736]Last question I can't seem to find a good answer to. I'm using Input.GetAxis so the player can bind their own controls, but I also want to flip a mesh based on which way it's going horizontally. I've pretty much tried everything from google and none of them are straightforward enough or they don't work.[/QUOTE]
what do you mean by [I]"flip a mesh based on which way it's going horizontally"[/I]? Like a player moving left or right in a 2d game and you want to change the direction he's facing?
Also, you don't have to use the shitty input manager for rebindable controls. You can store KeyCodes in variables and load/parse them from a config/ini file.
[editline]e[/editline]
so like:
[code]if (Input.GetKey(ConfigClass.SomeKey))
// do stuff[/code]
-Snip- I figured it out, I'm an idiot.
[QUOTE=Garrison;45148793]I have a 2D sidescrolling game and I want the player to face the direction that they are moving.[/QUOTE]
I would do something like this:
[code]float inputHorizontal = Input.GetAxis("Horizontal");
if ( inputHorizontal > 0 )
{
// Face one way
}
else if ( inputHorizontal < 0 )
{
// Face other way
}[/code]
[URL="http://docs.unity3d.com/ScriptReference/Input.GetKey.html"]Input.GetKey[/URL] returns a bool for whether or not a key is being pressed and I don't think you can do something like [I]Horizontal.Positive[/I]. (If I'm wrong about that let me know)
[URL="http://docs.unity3d.com/ScriptReference/Input.GetAxis.html"]Input.GetAxis[/URL] returns a float from -1 to 1 depending on whether the primary or alt key is being pressed for the given axis
Does this count as an update? I think this counts as an update. You can now interact with the environment and repair things. Also worked on a barebones building you can enter and a hugeass bio-dome surrounding the map.
[video=youtube_share;01NWeXEOvOY]http://www.youtube.com/watch?v=01NWeXEOvOY[/video]
[QUOTE=Jcorp;45160219]Does this count as an update? I think this counts as an update. You can now interact with the environment and repair things. Also worked on a barebones building you can enter and a hugeass bio-dome surrounding the map.
[video=youtube_share;01NWeXEOvOY]http://www.youtube.com/watch?v=01NWeXEOvOY[/video][/QUOTE]
You move WAYYYY too slow.
[QUOTE=Jcorp;45160219]Does this count as an update? I think this counts as an update. You can now interact with the environment and repair things. Also worked on a barebones building you can enter and a hugeass bio-dome surrounding the map.
[video=youtube_share;01NWeXEOvOY]http://www.youtube.com/watch?v=01NWeXEOvOY[/video][/QUOTE]
Looks really cool. You should try baking some AO into those models too.
Goes from this:
[IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-06/2014-06-19_19-46-58.jpg[/IMG]
[IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-06/2014-06-19_19-47-13.jpg[/IMG]
to this
[IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-06/2014-06-19_19-47-02.jpg[/IMG]
[IMG]https://dl.dropboxusercontent.com/u/13781308/ShareX/2014-06/2014-06-19_19-47-16.jpg[/IMG]
You could probably just do that with Unity lightmapping if the objects are static. If they're not you can bake an AO map with blender.
Sorry, you need to Log In to post a reply to this thread.