GTGD's Unity Multiplayer Tutorials

I’ve had a good read through of your script and it took me a little while to make sense of what you meant by “reading”, but I’m guessing that you mean that the compiler is reading that instruction in the script (my knowledge of that is limited). There’s nothing wrong with your script and if the comments make sense to you now, and in the future, then that is what’s important. If you want, you could even explain in the summary area what is meant by the term reading or any other terms that you may use in the future.

Your script looks neat and tidy and I found it very easy and pleasant to read the code.

Very very nice series thank you for putting this up. Put up a donation box so we can offer some hamburger money :slight_smile: Also will you be putting in 3rd person perspective with this series? I hope so.

Thanks Merries, I hadn’t implemented a 3rd person perspective in series 1, but it will be fun to implement so what I’ll do is to add it as an additional video at the end of series 1. So now we’ll have 35 videos instead of the original 34 that I planned, and your request will be video 35. You’ll have to wait several months while I roll out series 1 :).

Rather than a plain donate button I might make an exclusive, non essential, video available for sale when I’ve published most of series 1.

GTGD,

Thanks for the reply. My intention with the “reading” line is to try to verbally describe what each piece of the code is actually doing. Saying "// The following code makes the camera rotate" is great, but I struggle to identify what each of the sections of the code actually are doing.

Hence my attempt to explain the sections of the code using written words for each dot notation piece.

You by far have the best comments I’ve come across for tutorials, so a big thanks for that as it helps us new users out a lot.

Very impressive work, I will follow!

thank you so much for making a great tutorial, amazing one! your voice is pretty good :stuck_out_tongue: and I guess it’s American accent? will get my english improved throughout the tutorial as well ^^

as I was quite a novice for programming, I think it’s better for me to learn from this tutorial and start coding on my own game later. I’ll focus on only making project assets until then.

great job, keep it up! :razz:

10/10 the sound
10/10 the exploitation
3/10 i can’t wait the next show

good start and thank you for it

Thanks! I think you meant explanation rather than exploitation :slight_smile:

Thanks for the support Eiwer, and I hope that you find this tutorial series will help you in learning more programming so that you can build your game. I’m going to have to take more care with my usage of English so that I don’t start spreading any bad habits :p.

I’ve just published Video 7 Respawn Player Identity!

Thank you so much for taking the time to record these!
I’ve only watched video 4 for about half an hour so far, but I already see a great resource for many developers around here.

My next project will include multiplayer functionality and I only did some of the basics (RPCs, movement sync), with your help I will deepen my knowledge. And… most of your videos are longer than 2 hours, they should cover everything everybody ever need. Much appreciated!

Thanks Baroni, I can’t say that I’ll cover everything that anyone would ever need, with respect to multiplayer, but I will certainly be covering a lot! I’m hoping that developers following the series will gain a solid foundation in Unity multiplayer scripting, so that they’ll find it much easier to build their own projects. The more that I learn the more I realize how much I actually don’t know and there’s so much more scripting that I have yet to learn, and that’s a good thing! :smile:

Hey GTGD i have gone through all 7 videos over the weekend. and i think the tutorials are amazing,i like the style and big thumbs up on pronunciation, clear easy to understand speech is rare in video tutorials.Assuming you spend about 1.5* the length of the video, in time making it. I would have a probably bit more time during weekdays to spend on Unity which is understandable everyones job/life is different.

So I am going to add some things like,headshot (and torsoshot,armshot,legshot etc.), different weapons and other less coding intense things that i know how to add to your scripts since i am not so good at coding yet. My question is, is there anything coming up in future vids that comes to mind that might easily produce a problem depending on the things i implement (its not limited to the examples) and yes i am kinda asking for a sneak peek, hehe. Also do you have a ETA when the series will be done. No rush though just curious because i like to plan out what i do ,before i do it hehe.

Great Job so far :smile:

I’ll admit to being skeptical about these tutorials. I honestly thought it just another set of tutorials when I say the thread title. When I get more scripting knowledge down, I’ll try these out and see if I’m wrong, but not right now.

I thought that because of the thread title. I thought it was just another group of people making a tutorial. In all honesty, I still do. I hope you don’t take offense to any of that.

Btw, what scripting language do the tutorials start out using?

Just watch the video in the first post dude that will show you what the tutorials are about. Its like an overview.

Language is C#

Thanks for the feedback Squatsh! You watched all 7 videos over a weekend!

I’m pretty sure you can add what you’re intending without breaking the project for the future videos, though I’d suggest making a backup of the project files just in case.

I actually have a rough idea of how I would go about implementing torsoshot, armshot, etc. and what I imagined is using a bunch of colliders to represent each of those and to have a script attached to them that will simply pass on the damage message (attacker name, weapon type, shot modifier) to the main HealthAndDamage script. I’d imagine that I would use the HealthAndDamage script as the torso script and it would remain the main script for managing the players health. I would also keep the torso tag and collider the same as our Trigger collider (so the Trigger collider is the torso).

The HealthAndDamage script would probably need to be modified a little bit so that those other scripts, on those new colliders, could tell the HealthAndDamage script to apply a modifier depending on the type of shot. I will be implementing the area of effect rocket later on, in this series 1, and that could get a little tricky because it would see all the colliders so it might pay off for you to give the new colliders a different tag from the torso collider so that way only the torso collider would be recognised in area of effect damage application.

At my current rate of progress I might not be done with all the videos until May or June but that could change after video 10 because videos 3 to 10 are the main videos in this series and are the really long ones. The longest videos after that I think will have to do with the Construction Block and Air Block because of the large amount of scripting involved. The truth is that for each hour of video you watch it takes me about 3.5 hours to produce and that time consists of recording the video and then editing it.

Btw, when you do have your system worked out and functioning please do put in a video or a couple of screen shots of what you achieved in this forum thread. I’m sure a lot of viewers would be interested.

Thanks ChaosMax, I couldn’t have put that more concisely. When I saw OmniverseProductions post I was :face_with_spiral_eyes: and no I didn’t take offense to his post.

Hello,

I think this set of tutorials are really great and they are helping me to better understand scripting in C# and how unity works but I’ve run into a problem on the third tutorial with the FireBlaster script. The problem I think is with the word Instantiate at the end of the code because whenever I take that bit out, nothing else is wrong with the script. Please someone have a look at it and maybe tell me what I’m doing wrong.

Thanks in advance!
-Justin

Here is the script I have written following the tutorial:

using UnityEngine;
using System.Collections;

/// <summary>
/// This script is attached to the player and allows
/// them to fire the Blaster projectile
/// </summary>

public class FireBlaster : MonoBehaviour {
	
	// Variables Start______________________________________
	
	// The Blaster projectile is attached to this in the Inspector
	public GameObject Blaster;

	// Quick references
	private Transform MyTransform;

	private Transform CameraHeadTransform;

	// The position at which the projectile should be instantiated
	private Vector3 LaunchPosition = new Vector3();

	// Used to control the rate of fire
	private float FireRate = 0.2f;

	private float NextFire = 0;

	// Variables End_______________________________________

	// Use this for initialization
	void Start () 
	{
		MyTransform = transform;
		CameraHeadTransform = MyTransform.FindChild("CameraHead");
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(Input.GetButton("Fire Weapon")  Time.time > NextFire)
		{
			NextFire = Time.time + FireRate;
			// The launch position of the projectile
			LaunchPosition = CameraHeadTransform.TransformPoint(0, 0, 0.2f)
			// Create the Blaster projectile at the LAunchPosition and tilt it's angle 
			// so that it's horizontal using the angle eulerAngles.x + 90
			Instantiate(Blaster,LaunchPosition,Quaternion.Euler(CameraHeadTransform.eulerAngles.x + 90,MyTransform.eulerAngles.y, 0));
		}
	}
}

scripts are in download => Gamer To Game Developer - Downloads

LOL justintmetal, I can see the error in your code :sunglasses:.

This line is missing a semi colon at the end LaunchPosition = CameraHeadTransform.TransformPoint(0, 0, 0.2f)

If you make that correction I believe your script will run just fine. Don’t be embarrassed because I’m pretty sure that just about everyone has made this sort of silly mistake. The lesson to be learnt from this is to always look for the most silly errors that could have been possibly made first (like not plugging an appliance into the wall and wondering why it’s not working).

Thanks for posting your code up as it made it easy to debug.