RPG Tutorial curser affordance issue

Hi…is anyone who completed the RPG class with Unity 2018 getting issue with curser affordance when they hover over an enemy? I cant fix it for the life of me!

I have had a similar problem. For me the enemy was sometimes picked up but at other times it was as if the enemy is being treated as walkable.

What worked for me was setting collision detection from discrete to continuous on the enemy rigidbody, ala this suggestion I found in unity answers: https://answers.unity.com/questions/39204/raycast-missing-its-target.html

Hopefully this works for you too, and it would be great if someone could come on and explain. (trying to look up some info now and may add to post later)

Another way that seems to fix it: and this is probably the correct way to do it is to change from an update to fixedupdate loop for the cameraraycaster (this is how physics is supposed to be handled anyways).

Hi,

Thanks for the suggestion to change to fixedupdate part resolved my issue. :grinning:

when i now hover over an enemy and click my player attacks but the curser still remains on a walkable layer ie not an enemy.

Ive narrowed down when it occurs for me - it is after a cut scene made in timeline or the asset Dialogue System pixel crushers (which is awesome)…so it is whenever the camera changes then reverts back to normal game camera.

Hopefully there is a solution in part 2.

I hope so too. I’m not at that part of the course yet because I wanted to take a step back and learn how to create models of my own, but I wouldn’t be surprised if that happens to me too.

Looking forward to it and I hope your able to make progress with your game as well!

Unfortunatly as this is outside the concept of our game it probably wont get fixed in part 2.
However it sounds like when you change the camera back and forth its losing the cursor affordance that was loaded at runtime

This might give you a thread to pull on for a solution though

i have been performing some testing and identified it is all time. Not just after a cut scene.

the attack curser appears about 1 meter on the right of the enemy. My curser hotspot is set to 0,0.

I am using a cinemachine camera so maybe that is interfering…

Hmm if its happening all the time i suspect its something more than cinemachine although it is possible as i havent got to using it yet.
I would compare the code with the github just to be sure that the code is the same (within reason) but this could also be combined with that there is an issue with the raycasting not returning the first thing it hits all the time which we fix later in the course.

I wonder though as this is coming up more often that things have started to break around this lecture.

We are remastering this course and an update on it should be coming in a few days.
I havent encountered this issue in the testing i have done and i cant recreate it here either looking at my project.

I would test removing cinecamera in case it is the issue but more likely its version or code related.

ok thanks for your thoughts…it could be unity 2018.3…i saw someone else posted the same thing using this version of unity.

I know some have had issues where the layers in the layer array were in the wrong order enemy above walkable so that might be an issue that you have there as well.

no i have finished the course and i believe we got rid of the layers. i will double check the code though.

1 Like

Ah my bad on that then i thought you were still back on the adding of the cursors.
So when did you actually notice they stopped working correctly?

As much information as possible is great and thanks in advance for all this information.

@Rick_Davidson @sampattuzzi

New one on me.

is there anywhere i can get the full camera raycaster script? I will ensure my code is exactly the same as a first step…

my code is the same…hmmm…it was always happening but i thought it would be fixed at some stage…

i believe i have fixed it…i noticed an odd script on my camera…a third party asset must have put it there. I removed it and getting much better results. i can see the attack curser over an enemy.

1 Like

Sorry its been a busy day so i wasnt able to reply till now.

If you click the 3 horizontal lines at the top left of each video it will open a panel. This panel is a list of lectures and under each one is a project changes link. This means you can download the project at the state at the end of the video to compare :slight_smile:

Glad to hear that you think it may be solved a rogue script would explain the odd behaviour.

Keep an eye on it and let us know if the problem persists, if not well done on stomping that bug!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms