[QUOTE=MilkBiscuit;47369985]Do you guys have a strong opinion on [URL="http://docs.unity3d.com/ScriptReference/GameObject.SendMessage.html"]SendMessage[/URL]? I really need to use it in my current project for reasons, but everywhere I look I see people bashing it. Facepunch generally seems better than the Unity forums for stuff like this.[/QUOTE]
As an alternative to SendMessage, look at delegates just because they are much much faster.
I'm writing a shader in Cg (a hybrid of the C languages) for the Unity game engine.
In my particular case, I need to take a coordinate, and align it to a grid. Which means, I'm finding the closest multiple of N to the coordinate.
[code]
float multipleof = 50;
float = floor(vertexpos.x/multipleof);
float distortion = lerp(psuedorand(gridx),psuedorand(gridx+1),distance(vertexpos.x,grid*multipleof)/multipleof);
[/code]
Psuedorand is a function that generates a "random" seeded value. So you have a grid square, where grid is the grid square along the x axis that the vertex position resides in, and a distortion value that is lerped from one grid value's "random" to another grid value beside it, by a percentage of where the vertex position is.
Problem: the distance between the vertex and the grid location comes up as greater than 50.
How?
The distance is the vertex to the grid*multipleof, but grid is vertex.x/multipleof... so the distance MUST be between the vertex position and the nearest grid-locked position.
This is fucking it all up. What's going on?
Does anyone have any experience with SpeedTree? Is there any way to cut down on the file size required to have multiple variants of the same model using the random generation function?
Cross posting this from WAYWO, but I'm pretty happy with this now. I've been working on getting a very similar effect to the nebula from Freelancer. It's a wonderfully simple, yet very effective effect.
All the basic features of the nebula I had intended are now in. It looks big and fluffy from the outside. When you fly into it, you have a smooth transition. The inside has its own lighting, and you get ambient particles that move around you while inside. I only wanted to spend a week on this diversion, so aside from polish that will happen over time, this is pretty good for an initial implementation.
If I have enough time tonight I might see if I can sneak in cloud lightning.
The first video shows the fade and transition. The way that the ambient lighting and sunlight changed, as well as the way that the particles get more and more opaque the deeper you go in is really neat. The second is mostly just showing how the particles work. I think the settings could be adjusted to make the particles look nicer and blend better, but that's just adjusting properties in the Inspector at that point.
[vid]http://a.pomf.se/zkxwwm.webm[/vid]
[vid]http://a.pomf.se/okvirp.webm[/vid]
All you need to create a nebula is a GameObject with the Nebula component on it, and a child GameObject with a special nebula mesh collider. The nebula puffs are optional. They're the small clouds you fly by inside the cloud and can just be added onto a nebula component. You can have as many as you want so you can have different kinds of particles running concurrently.
[img]http://i.imgur.com/XKCQQnh.png[/img]
Hello guys I have problem with Blob Shadow Projector! It flickers when close to it with camera :(.
Some points first:
.: I think I have set far and near camera very well.
.:I have enabled 24bit depth buffer (or is it 32bit I dunno)
.: OpenGL ES 2.0 Simulation enabled, same stuff hapens in Editor and mobile devices
.: I have set Offset -1, -1
Images of the problem:
[IMG]http://i.imgur.com/xddDPIV.png[/IMG]
[IMG]http://i.imgur.com/qDP17Ru.png[/IMG]
(I have sized projecto so that it covers whole level/scene, same stuff happens if projector is normal shadow size).
[editline]24th March 2015[/editline]
Ok, I changed Offset -1, -1 to Offset -1,-10 inside shader, not sure what it does but it helps (issue is still present but at really close distance to the mesh.
Does anyone know of any good text-based unity tutorials? I mean, I like videos and all, but I have an easier time with texts, since its a lot quicker to reference rather than trying to find that spot in the video and having it buffer all the time due to me skipping around.
Kinda new to unity, somewhat decent with C#, btw.
So I spent 2 hours following a C# tutorial and translating it to Unityscript so that I could understand the tutorial a bit more. After 2 hours, I press play and nothing happens. No errors or anything.
That's when I switched to using C# :v
How can I change the animation speed of a specific animation-state in an animator? I want my character to swing his arms faster when he runs faster, but I don't want him to 'attack' faster, you know?
This works fine for his legs, because I just set the animator-speed relative to his speed, because there's only running and the idle animation for the legs.
[QUOTE=war_man333;47394524]How can I change the animation speed of a specific animation-state in an animator? I want my character to swing his arms faster when he runs faster, but I don't want him to 'attack' faster, you know?
This works fine for his legs, because I just set the animator-speed relative to his speed, because there's only running and the idle animation for the legs.[/QUOTE]
This is not possible yet, apart from messing around with blend states. In Unity 5.1, you'll be able to bind an animation parameter to the speed of an animation clip.
[url=http://forum.unity3d.com/threads/mecanim-change-animation-speed-of-specific-animation-or-layers.160395/page-2#post-2000306]Source[/url]
[QUOTE=war_man333;47394524]How can I change the animation speed of a specific animation-state in an animator? I want my character to swing his arms faster when he runs faster, but I don't want him to 'attack' faster, you know?
This works fine for his legs, because I just set the animator-speed relative to his speed, because there's only running and the idle animation for the legs.[/QUOTE]
I had same problem, and I think it's quite .. impossible (in Mecanim).
You can try blend tree with same animation but different speed... but that may not really work
I think with legacy animations it's possible though.
Oh. We're still on 5.0 right?
[QUOTE=war_man333;47394764]Oh. We're still on 5.0 right?[/QUOTE]
Yep.
[QUOTE=Cryomundus;47392234]Does anyone know of any good text-based unity tutorials? I mean, I like videos and all, but I have an easier time with texts, since its a lot quicker to reference rather than trying to find that spot in the video and having it buffer all the time due to me skipping around.
Kinda new to unity, somewhat decent with C#, btw.[/QUOTE]
Try Catlike Coding
How do you implement a 'physics-system' like in Castle Crashers? It's 2D, but objects still know when to stop falling, like it was 3D.
Can you set a collider to ignore EVERYTHING except 1 other collider, without having to use 'layers', because layers don't really work dynamically afaik.
You can give a collider it's own layer and then in the Edit -> Project Settings -> Physics2D you can make the collider layer ignore everything but some other layer using the Physics2D Matrix.
Is it normal not to have any packages in Unity 5?
[img]http://i.imgur.com/QGtDLzt.png[/img]
That's really weird, my copy of Unity 5 [I]did[/I] come with standard assets... did that change after release or something?
[QUOTE=Rocket;47409823]You asked the same thing last week, and you got a reply:[/QUOTE]
Oh I forgot, sorry. I checked the assets store if that is the place but could find them.
[editline]28th March 2015[/editline]
[QUOTE=BackwardSpy;47410097]That's really weird, my copy of Unity 5 [I]did[/I] come with standard assets... did that change after release or something?[/QUOTE]
Well I downloaded unity the day it came out so not sure.
[QUOTE=BackwardSpy;47410097]That's really weird, my copy of Unity 5 [I]did[/I] come with standard assets... did that change after release or something?[/QUOTE]
I installed it a week ago or so, and the installer asked me if it should download the standard assets package for me
[QUOTE=Goz3rr;47410860]I installed it a week ago or so, and the installer asked me if it should download the standard assets package for me[/QUOTE]
It's not fair -_-, I've been looking around for the assets but I can't find them anywhere.
[editline]28th March 2015[/editline]
I just went on their website and downloaded the installer, I unchecked Unity 5 and checked Standard Assets and now I am downloading them.
Well when I downloaded Unity 5 I didn't used the installed I downloaded it in chrome and I installed only Unity 5.
So I have a vertex shader. The important bit:
[code]
distortionx = <insert math here>;
height = sin(globalVertexPos.x*distortionx);
[/code]
Distortionx is [B]always[/B] between 1 and 0. I can verify this as well, using checks that throw the height to 1000 if it isn't, or by setting the height value itself to the distortionx without the sine wave (resulting in it displaying the distortionx via height and indeed being between 0 and 1). Truly, it appears to act as expected mathematically.
This is what a distortionx of 1 looks like, if I replace the math with just a static 1:
[t]http://foxcock.me/web/images/zscreen/2015_03/Screenshot-2015-03-28_12.01.20.png[/t]
This is what a distortionx of 2 looks like, replacing the math with a static 2 (which should never normally occur):
[t]http://foxcock.me/web/images/zscreen/2015_03/Screenshot-2015-03-28_12.01.30.png[/t]
And yet, here's what I'm getting from the math that [I]supposedly[/I] isn't greater than 1:
[t]http://foxcock.me/web/images/zscreen/2015_03/Screenshot-2015-03-28_12.01.50.png[/t]
What on earth?
sketchup is really useful for easily creating low poly non organic models
[video=youtube;QYgUjO-zrYo]http://www.youtube.com/watch?v=QYgUjO-zrYo[/video]
the only thing i hate about sketchup is that it is terrible at UV mapping, so i have to do that in blender
Is it possible to look if the current object has a component (Script) using GetComponent<XXX>() but without entering the entire script name. So basically find script that starts with "Function", the script could be called "Function_Attack".
[QUOTE=BoowmanTech;47417042]Is it possible to look if the current object has a component (Script) using GetComponent<XXX>() but without entering the entire script name. So basically find script that starts with "Function", the script could be called "Function_Attack".[/QUOTE]
Perhaps a nicer way would be to create an interface like IFunctionComponent, which all "Function_X" classes implement. Then you should be able to do GetComponents<IFunctionComponent>(). This should be more efficient than searching for components based on their type names, and will let you specify methods / properties that all IFunctionComponent implementing classes should provide.
[QUOTE=Ziks;47417069]Perhaps a nicer way would be to create an interface like IFunctionComponent, which all "Function_X" classes implement. Then you should be able to do GetComponents<IFunctionComponent>(). This should be more efficient than searching for components based on their type names, and will let you specify methods / properties that all IFunctionComponent implementing classes should provide.[/QUOTE]
Oh ok, I will give that a try.
Thanks
I put this together in a few hours to mock up a proposed joystick controlled gimbal thing in the Star Citizen thread, but I think it's kinda neat and I'm happy for having done this so quickly.
[img]http://i.imgur.com/nsmdqmb.png[/img]
For those that would prefer to try it in a separate browser: [url]https://dl.dropboxusercontent.com/u/15133164/FloatingCrosshair/Web.html[/url]
For those that would rather download it: [url]https://dl.dropboxusercontent.com/u/15133164/FloatingCrosshair/Crosshair.zip[/url]
[unity]https://dl.dropboxusercontent.com/u/15133164/FloatingCrosshair/Web.unity3d[/unity]
Well since there is no way for me to turn it kinda sucked :(
Other than that the game looks nice and the movement is pretty nice :D
Just submitted my 48 hour game jam compo game made in Unity. I'm very happy with the result, and I'll probably expand it to a complete game. Although the temptation to make it a free-to-play mobile game is immense, the angel on my shoulder is saying I shouldn't. :V
[url]http://asgardr.itch.io/prehistoric-game-jam[/url]
[QUOTE=BoowmanTech;47419822]Well since there is no way for me to turn it kinda sucked :([/QUOTE]
It's specifically to prove a point about joysticks, so making it controllable any other way would've defeated the purpose.
Sorry, you need to Log In to post a reply to this thread.