I was trying to make a game where when you touch a light you cant pass through it or you get damaged so what i really wanted to do was using hard light or creating something like hard light for a platfromer game.
I think I understand what you mean, what you can try to do is to use a cube or any other object with collider and with specific shader. If you have 2D game I recommend you to watch this video or learn more about shadergraph For damage you can use the simple health script and OnTriggerEnter function to reduce health.
Related
I'm making a 2D-game with Unity, but i'm making it in 3D-environment because 2D-environment doesn't support NavMesh. Now i noticed that 3D-environment doesn't support the new 2D-lights which i would love to use for the game. Is there any way to use the 2D-lights in 3D-environment? Or what would be the best way to make the 2D game use the lights and cast shadows in 3d-environment?
Thx.
I could just convert it to 3D, forget the NavMesh and control the character with keyboard, in that way i could use the 2D-lights, BUT i would love to have the NavMesh and baking attached to it, because the game's a clicker, and the character is more fun to move with a mouse.
I've developed an airplane 3D shooter game. In this game, I want to make my plane shot a bomb. When the bomb gets to the enemies it will explode and give damage in the area of explosion.
I have already searched for a tutorial to make this code and the animation of explosion. But I couldn't find it. Please tell me about something that could solve this problem. I'm developing my game using C#.
For the explosion animation, you could use a particle system. There are many pre-made ones in the Asset Store, such as this one: https://www.assetstore.unity3d.com/en/#!/content/42285
For detecting what is affected in the explosion's area of effect, do a SphereCast (https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html) from the point of impact and then do whatever you want with any of the objects touched by the sphere.
I'm making a FPS game in Unity, and I want the environment to light up as the player is shooting on his environment.
So say I have a tree. First it would be entirely black or greyish, but if I shoot somewhere, I would see some green.
To accomplish this feature, I'm using a raycast to have the impact point and so I can access any renderer of the point that the player is shooting on.
I guess the next step would be to write a custom shader to light the exact pixel that is shot.
Do you have any idea how I could write this shader or another way of doing this effect?
Regards
If you are using deferred rendering: Deferred decals.
If you are using forward rendering: Projectors.
If you need some more advanced "paint-like" functionality, use render textures coupled with RaycastHit.textureCoord to get the exact UV coordinate at your ray intersection point. You can draw stuff to render textures using Graphics.Blit. Check out this github project for some inspiration on how to do this.
I am new to Unity and am trying to create a simple 2d platformer. I have applied a box collider to my player sprite and the floor/platform its standing on. Now when I go over the platform, it toppes off of it as expected, but I want it to simple fall off it instead of toppling. How can I do this?
Also I saw a video of Unity Live Training in which he was using a separate circular collider for the player's feet.When I did this ,the sprite started rolling. Can anybody help me with this?
There is an "fixed angle" option on Rigidbody2D component, try enabling that
In older games Ive made levels in, like unreal or half-life the skybox is a parallaxed texture that you assign to world geometry, for instance, the ceiling of your room, to give the illusion of the room being open to the sky.
There are some neat tricks or weird things you can achieve with this 'sky portal' method. For example you could have 'sky' in an underground room. or walk through a hole in the sky.
I'm wondering is it possible to make a mesh in unity3d render as part of the skybox like in these older engines.
You can do this yes. Usually you assign a "SkyBox" to your camera and change the "Clear Flags" for her "SkyBox". However, there are other ways to do.
Learn more here: http://docs.unity3d.com/Documentation/Components/class-Skybox.html
Hope this help !