Be the first to post for 'Using Gizmos To Visualise Code'!

rpg_s02_using_gizmos_to_visualise_code

#24

I have to say that this is one of the most confusing of your videos that I have seen. Gizmos themselves seem to be pretty straightforward but the code changes and refactoring that you do feels very rushed and difficult to follow, possibly because you copy in chunks of code ‘from one I prepared earlier’, although you do review the code it takes quite a while to understand exactly what you are doing. I mention this because it seems to be such a contrast to your usual style of carefully taking the student through the code and building up understanding step by step.


#25

@MithrilMan thank you your post really helped with my concept for my game. I am using 1.5 for my melee attack radius. that comes out to about 5 feet. For my ranged I’m going to use 10.


#26

thx man yo saved my day…I had a same issue now solved .thank you very much.


#27

Hey would anyone be kind enough to share their code up to this point. I was trying to code a little in my own direction but I’m not quite skilled enough as a coder to do that yet >_< so I want to follow this project exactly but I don’t really want to rewatch the last 4 hours to get all the code


#28

This is my gizmos for move and attack


#29

The gizmos. Pretty much what was requested. I also made a light that follows the cursor before the cursor affordances episode, just in case anyone wonder what Gizmos are those.

Progress being made.


#30


A gizmo.
Gizmo.
Gizmo.
‘Gizmo’ no longer sounds like a real word.


#31

I too was having the turning on location issue, have replaced with walkmovestopradius but doesn’t fix it when I click on an enemy! ohwell will fix it when the navmesh changes come in. really enjoying the course so far!


#32

I separated the melee and ranged attack distances.

void OnDrawGizmos()
{
    Gizmos.color = Color.grey;
    Gizmos.DrawLine(transform.position, CurrentClickTarget);
    Gizmos.DrawSphere(CurrentClickTarget, 0.1f);
    Gizmos.DrawSphere(ClickPoint, 0.15f);

    //Draw Melee attack sphere.
    Gizmos.color = Color.red;
    Gizmos.DrawWireSphere(transform.position, MeleeAttackStopRadius);

    //Draw Range attack sphere.
    Gizmos.color = Color.cyan;
    Gizmos.DrawWireSphere(transform.position, RangeAttackStopRadius);
}

#33

I’m currently focusing on gamepad movement. I have a sphere gizmo to show the targeting range. If there are enemies in the scene I can target the closest one (and switch between them in order of their horizontal screen position) by pressing one of the shoulder buttons. I draw a line gizmo to the currently selected target.


#34

That is what I intend to do for Gamepad support as well. Cool.


#35

The second yellow sphere is to mock ranged attack radius like a flamethrower, or the radius of an Aura or whatever. I will comment it out though. The red sphere is for melee attacks, it is set to 1.5 meters which should be about the range of your arm + a crowbar or a standard sword/axe.

Otherwise I liked what was used in the video and saw no reason to change anything.


#36

Thank you!


#37

Hi

I decided to go for a bubble effect/blood cell effect for my health bar mask.


#38

Hey guys,

I found a simple solution to the turning player character after the refactoring. Turns out the cameraRaycaster.hit.point also delivers the y-coordinate of the hit. In my case my player character wanted to reach his target high up in the air when I clicked bigger enemys. So the magnitude never really went to zero because of the height difference between player y-position and the click on the large enemy). I changed this by simply setting the point of the click to the cameraRaycaster.hit.point but reseted the y-coordinate of the Vector3 to the players y-position when storing the hit info

pointOfClick = new Vector3(cameraRaycaster.hit.point.x, transform.position.y, cameraRaycaster.hit.point.z);

This worked for me, maybe it will help some of you with your turning problems.

Cheers and happy coding!