Sprites is not getting assigned to the material [closed] - unity3d

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
For creating a background scrolling for my game, I created a quad(3D object) gameobject and a material and assigned the material to the gameobject. Then I got the background sprite for my game and attached it to the material in the albedo section. But the material shows like the sprite is not assigned at all. The material is still violet in colour. What settings am I missing and what option did I get wrong. Please help me. I have attached the screenshot of sprite and material settings in the inspector. For background scrolling, I followed this video: https://www.youtube.com/watch?v=RXNXEIwOLMA.
MaterialInspector
SpriteInspector

There is a better way to do it for your use case. Follow these steps:
1- Select your sprite and change the texture type to Sprite (2D and UI).
2- Add a Sprite Renderer component to your quad. Then, select your image for the Sprite section of Sprite Renderer component.
You see a violet color when the shader pipeline has an error or something is broken with the rendering, which is the case here for you. If you do the steps above it should work though.

Related

Trail Render not become visible during game play

I was working on simple 2d game and in that at player end, I want to attach trail effect. So I have added trail renderer component by creating child empty gameobject.
Also I have set proper trail rendering order as well. Here are more details with images so please check these:
Actual trail get drawn but not visible on game or in scene area.
Here is the component values those I set for trail renderer:
Now I hope you got my point so please share your suggestion regarding this.
Thank you for giving time for this question :)
Trail Renderer more details:
Player more details:
Gameplay more details:
Actually game play remain at same location, just I am dragging player ball through mouse so no rotation get included.
Still if you need more information then you can ask for that I will provide those as fast as possible.
I have solved this problem after doing some tries. Here I am posting an answer so this become useful to other members.
I require to set Material type to Mobile/Particles then after it become visible within game play. Though sorting order related setting is necessary that I was did before. But material related settings I don't knew before.

Unity - Activating "is Trigger" makes stuff fall through objects [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I am following this tutorial: https://www.mvcode.com/lessons/roll-a-ball-obstacle-course
At the very end we created enemies (cubes) and their movement works very good. But as soon as I activate "is Trigger" they fall through the plane into the void. What am I missing?
I tried to pull them above the floor to have some space between the bottom and the enemies, but they keep falling through the floor and only when I got "is Trigger" enabled.
thanks in advance,
Akuma
Alternatively (for those people who want or need gravity enabled on their cubes):
Add a second collider.
There's literally nothing stopping you from doing this. You can make the trigger one bigger or just tweak the physics layers collision settings so that the collider keeping the enemies on the ground doesn't interfere with the operation of colliding with the player, etc.
It's likely that the cube is on top of the floor. When you enable "Is Trigger", collision is disabled and the cube would go through the floor.
The solution is to disable "Use Gravity" on the cube's Rigidbody.
Note that you are following a plagiarized version of the original "Roll-a-ball tutorial" tutorial which left out so many things. You should be following the original tutorial here. Watch the 10 seconds from this video which describes what you missed which is what I described above.

Unity 5 - 2D game - separate scenes vs panels [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I try read all post like
http://forum.unity3d.com/threads/scenes-vs-canvases-vs-panels.279890/
http://forum.unity3d.com/threads/with-new-ui-separate-scenes-or-just-separate-panels.281013/
and others and still don't understand what is better way?
Scenes vs panels.
I'm personally thing scenes is better - I feel separate levels.
A game i try to write familiar to candy crush and how i understand they use scenes - because from map to play new matches gam you see loading screen - i thing this is some scene.
Thank you
because from map to play new matches gam you see loading screen
Because you see a loading screen does not mean that the game is actually laoding a scene. Anyone can put a loading screen up while doing something else such as loading AssetBundles and not actually loading the scene.
Your question will only result to opinion answer since you don't really have any problem.
I have my own rules I use after experimenting with Unity.
If you are making a 3D game with color map, normal map, height map and other textures, use Scene. Separate the scenes to speed up loading each level.
Now, if you are making a 2D Game as simple as candy Crush that uses few Sprites and Images simply use Canvas/Panels. Make Level 1 as parent Canvas GameObject. For level 2, simply duplicate the Level 1 parent Canvas, rename it to Level 2 then make a little changes to it. You can switch levels by enabling and disabling the parent Canvas GameObjects.
This make modifying your 2D Game very easy.You can easily compare what two levels look like by enabling/disabling them. You don't have to load up another scene to get another level. Also loading scene takes time too but this eliminates that.
Another advantage of this is that you can always convert the Canvas parent of each level into a prefab then import it into another level if you want to start using scenes instead.

Why Isn't My 2D Box Collider Working? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
i'm making boundaries for the characters in my 2d game in unity 5. I added box colliders to the borders and my characters but the characters don't stop when they run into the other borders.
I don't have much experience of Unity 5, but probably these things work similarly than with old versions of Unity.
Colliders can be used for stopping things to go inside each other without writing your own OnCollisionEnter function.
So there must be some other problem. Check that:
Colliders are same type. 2D and 3D colliders don't detect collisions with each other.
At least one participant of the collision needs to have rigidbody component attached.
Check that is trigger is not selected on any of the colliders
Pause the game and check in the scene view that the green boxes of the colliders actually colliding
Check the layers of the gameobjects and check if they are should collide because of the layer based collision
When the colliders intersect it will trigger an OnCollisionEnter event. You need to tell it what to do after that. It could be setting the velocity to 0 in the case of a ball hitting the wall, or it could be awakening enemies in the case of a player walking into a trap. You have to define the behavior.

Unity3D Applying Texture - Model turns black [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am following a course to learn Unity3D.
Game Development for iPhone/iPad Using Unity iPhone Tutorials
http://www.vtc.com/products/Game-Development-for-iPhone-iPad-Using-Unity-iPhone-Tutorials.htm
I am following along whatever author is doing on the screen. He is using Unity 1.6 and I am using Unity 3.40f5
When I try to apply the texture as he does in the movie, my model turns black. Is there something trivial that I am missing here?
Also find the screenshot attached.
Whats happening in the movie with author -
Whats happening on my screen -
It's hard to tell from screen grabs but your material looks correct, assuming it says "Bumped Diffuse" after shader, I can't tell.
When you first drag your model the scene, before applying a texture, it should self shade. If it doesn't, you need to regenerate your model's normals by clicking on the model and then in the inspector look for "Normals and Tangents." After Normals choose "Calculate" the click "Apply" at the bottom, see what happens. I don't know your model type but Unity has given me trouble in the past with Wavefront .obj files predefining their normals.
The other possible issue is a faulty UV import. If the tutorial is from v1.6 it is possible the model included with the tutorial isn't importing correctly. I've had a similar issue where the UV's were all set to '0 0' so only the lowest corner pixel of my texture was used. Unity can't do anything for you there. You can test this by creating a new material. Set the shader to diffuse. Set 'Base(RGB)' texture to 'none', and set 'Main Color' to something like blue. Apply it to your model. If you don't define a texture then your model should appear blue. If it does, it means you likely have a UV import problem.
You just create the material as well but I think you did not import it to the object.