I went through the whole first course in Udemy for doing mobile games with Unity, and the only issue I had was that for some weird reason the ball bounces back from the pivot point/object after it gets launched. Any idea what could be the reason?
The ball prefab has “Order in layer” set to 1, while the pivot has “Order in layer” set to 0. Doesn’t that mean that they shouldn’t contact with each other?
It sounds like that the detachment code is not working and so its still connected to the pivot rather than releasing as we had this in a previous lecture.
I would compare your code to that in the course using the Project Changes link in the resources to rule out an issue there.
If you cant find it please post your ball launcher code here and we can take a look
The links in the course (in Udemy) don’t work - so I had to find the repo in other way and then compare. I can’t find any problematic differences between the code. I think it could be some setting of the materials, so here are screenshots of both the pivot and the ball prefab settings:
Thanks for that information.
I have checked the links on udemy and they appear to be working for me to get to the changes page on gitlab.
That aside the issue is because you have a box collider 2D on your pivot.
I would remove that and retest as i believe it should all work correctly then.
If you are having issues after this please do let me know and i will pick it up in the morning (I checked in as was at the pc and my phone notified me)
(I’m on Linux as the video looks to be shot on Windows.)
And one last thing that I don’t get: the balls and the pivot have different “Order in layer” … isn’t that sufficient so that they do not “collide” with each other?
In any case - thank you so much for the quick responses - and for the help
I think that the two questions link into the same answer here.
Order Layers are on the sprite renderer and so that its the order in which they render.
The reason we changed ours although i didnt really experience this visually is because the ball was rendering behind the pivot and giving Nathan an odd shading issue.
Order layers wont ignore collisions because we would need to tell the physics system to ignore the collisions say on the ball from anything on the order layer for the pivot.
Its much easier to just remove the collider as we are not using it in either case.
Thank you very much for the good explanation, Marc
I’ll mark this thread as “Solved”.
And one last tiny bit of information - I checked the links on Udemy with Google Chrome - and they work there. So guess there is issue with them only on Firefox - but of course, this is a problem of udemy.com itself