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.
Related
So I want to display a floating text everytime the player opens a chest, that indicates how many coins you earned. I created the level using tilemaps. The problem arises when I created the floating text, basically it's covered by the tilemap, because if I move it out of the level I can see it, otherwise not. I tried fixing this problem by using layers, but I can't manage to make it work. Does anyone know how to help me?
As you can see by the foto the outline of the text is visible, but in play mode you can't see it.
You should probably use the order in layer in the tilemap renderer and set it to a negative value.Im sorry if it doesnt work I am new to unity.
I have a platform that I need to flip the direction of when it collides with an object. The platform as well as its child objects belong to the layer "FlyingOrPlatform". The object that the platform collides with should belong to the "GameControl" layer. But if i set it to that it doesnt collide with it.
If I set the object that the platform collides with to either the "Player" or "Default" layer. Then it works completely as it should. But I wish to use the "GameControl" layer.
I have tried where I save the scene and the project, as well as restarting the editor.
I dont see what should be wrong with my layer setup. Any suggestions?
In my script for reversing the platform direction there is no layer check, it does check the tag but I ensured that the tag is the same when I switch between the layers. I just use Unity's built in OnTriggerEnter2D lifecycle method. Have tested with OnCollisionEnter2D and OnTriggerStay2D as well, same result.
Here is a link to a video demonstrating the issue, as well as a screenshot of my physics2D settings below. In the video I first show how its supposed to work, and then I switch the object the platform collides with to the GameControl layer, after which it doesnt work.
Video of issue: https://www.youtube.com/watch?v=l-eqYI-K-Ug
Physics2D settings:
From what I can tell this appears to be an issue with the Physics2D matrix in Unity that occurs from time to time. A couple of other people have written similar things on other forums.
Among others this reply had a similar issue:
For lack of better, I found a work-around by using the "Ignore Raycast" layer instead of the "GameControl" layer.
I have reported it as a bug to Unity.
EDIT:
Here is the reply I got from Unity.
"Hi,
We successfully reproduced this issue. It will be possible to follow
the progress on a chosen resolution in our public Issue Tracker once
the report has been processed (this might take up to an hour):
https://issuetracker.unity3d.com/product/unity/issues/guid/1325018
We highly appreciate your contribution. If you have further questions,
please feel free to contact us."
I am using Cinemachine asset in my Unity project and is working fine without any lag. However, the places in my Scene which has a lot of ladders, are facing intense lag, making the game unplayable. Such a scene is shown below.
Reasons that I can think of the lag is too many collisions happening or the cinemachine(may be). Two images below show the physics shape of the ladder sprite.
My camera is set-up inside an empty gameobject called "Cameras" as shown below. The state driven camera utilizes the player animator which is shown in the second screenshot. I am afraid that I can not provide a minimal reproducible example in this case. Could someone help me by pointing in the right direction to fix the lag?
EDIT: Unity profile also suggests that Physics usage is consuming too much CPU with CinemachineBrain.AfterPhysics() and Physics2D.FindNewContacts being the major culprit:
EDIT 2: The ladder is created using a tilemap component as shown below:
Can you try simplifying the collider boxes for the ladder to a single box collider shape?
I have successfully enabled 3d object detection through vuforia in Unity. I have attached a crosshair (reticle) at the centre of the screen in screenspace overlay. when the user moves his phone over the 3d object which is produced upon object detection, I want a label to appear when crosshair crosses different parts of the 3d object. I tried many methods including, collision, cursor and reticle. It is not working.
Is there any easy way to implement this so that I can use event trigger pointer enter to make few things happening on the game.
I successfully solved my problem. The solution is using worldspace crosshair.
Most of the crosshairs available in the assets are cemeraspace. therefore using a worldspace corsshair solved my problem. It may be useful to someone in future.
I'm trying to do some Augmented Reality in Unity using the Vuforia plugin. I've managed to get everything working (I'm using a 3d model of a car), only the position of the car relative to the marker is wrong when I come to preview it (click the 'Play button at the top and watch through the computer's camera - is 'preview' the right name for this?).
It should be sitting on the the marker in the center, but instead it's floating above the marker and off to the side by quite a bit. The positioning is definitely right in the program itself, so I'm not sure why this isn't reflected in the preview.
Also: at the moment the car is simply an untextured grey object. I realise the textures are included in a subfolder, however I can't drag the entire car's folder (including the Textures subfolder) into the ImageTarget, only the .3ds file itself. Does anyone know how to apply the original textures to the car?
Thanks so much for your help in advance!
Ben
Well, to start answering your question about the drifting away part, you've probably got a Rigidbody attached to your Car? Well, if that's the case, then Go to the Inspector where the Rigidbody is and you'll see constraints.
To avoid it floating off, you might want to check Freeze Positions for whichever direction it needs. Probably Y axis.
Now, I'm not entirely sure if you're using Vector.AddForce to move your objects, but if you are then just check if your car can move if you've put all constraints on.
If you can't then in your code trying using Object.Rigidbody.SetActive(true) when you need it to start moving, and Object.Rigidbody.SetActive(false) when its done.
On the other hand, if you aren't using Vector.AddForce() then remove Rigidbody component if you've used it.
As for the material. If you've got the material in your folder that you've downloaded then just drag and drop it into Assets. Now sometimes your car may be one solid mesh, but some times it may be multiple meshes. So which ever the case. Drag the material from your Assets onto the Hierarchy panel over your car mesh/meshes and it should turn into that color.
Hope it helps. :)