#Monodeath's Code Error
1 messages · Page 1 of 1 (latest)
```csharp
and share?
nope
how do I share the code with you all lol
```csharp
your code
```
oh ok
```csharp
Test
```
yeah, backslash is only to help people see how to do code commenting
yeah you got it
side note, asciidoc instead of csharp is a great way to take notes in discord
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
private float horizontal;
[field: SerializeField]
private PlayerStatsScriptableObject speed;
private float jumpingPower = 16f;
private bool isFacingRight = true;
[SerializeField] private Rigidbody2D rb;
[SerializeField] private Transform groundCheck;
[SerializeField] private LayerMask groundLayer;
// Update is called once per frame
void Update()
{
horizontal = Input.GetAxis("Horizontal");
if (Input.GetButtonDown("Jump") && IsGrounded())
{
rb.velocity = new Vector2(rb.velocity.x, jumpingPower);
}
if(Input.GetButtonUp("Jump") && rb.velocity.y > 0f)
{
rb.velocity = new Vector2(rb.velocity.x, rb.velocity.y * 0.5f);
}
Flip();
}
//speed = (PlayerStatsScriptableObject)ScriptableObject.CreateInstance(typeof(PlayerStatsScriptableObject));
private void FixedUpdate()
{
speed = (PlayerStatsScriptableObject)ScriptableObject.CreateInstance(typeof(PlayerStatsScriptableObject));
rb.velocity = new Vector2(horizontal * PlayerStatsScriptableObject.speed, rb.velocity.y);
}
private bool IsGrounded()
{
return Physics2D.OverlapCircle(groundCheck.position, 0.2f, groundLayer);
}
private void Flip()
{
if(isFacingRight && horizontal < 0f || !isFacingRight && horizontal > 0f)
{
isFacingRight = !isFacingRight;
Vector3 localScale = transform.localScale;
localScale.x *= -1f;
transform.localScale = localScale;
}
}
}
= header =
* list item 1
* list item 2
thingy :: thingy
thingy :: thingy
= another header =
[important]
blah blah blah
so, whats the issue?
so I’m trying to use a ScriptableObject to make changeable stats
oh i figured it out already
wait, no thats discord confusing me with indentation, hold on
i thought you were declaring private methods inside of update then lmao
had to open the thread fullscreen instead of split screen 😂
Ok so I’m trying to make a stat system with Scriptable Objects, but the console keeps saying “an object reference is required for the non-static field, method, or property ‘PlayerStatsScriptableObject.speed’
and it won’t actually change the speed of the player when I edit the scriptable object’s speed
an object reference is required, that means the thing doesnt actually exist yet in your code
youve declared that an object CAN exist, but it hasnt been hooked up to the script yet
its non static, thats because you can make multiple of them
with their own settings
so how do I fix it?
so you need to either, on awake, or on start, actually initialize that scriptableObject
so that the code doesnt try to read an empty reference
sorry if I’m wrong on any part
i would put above the void Update function
onAwake()
CreateInstance.PlayerStatsScriptableObject
which var
then just drag and drop the object into the inspector reference
the scriptableObject
then in the inspector area, it will appear, you can drop the scriptableObject from your assets straight onto it
the script itself, the one youve edited
Sorry if I’m bad at this, I started Unity roughly 2 hours ago 😅
thats alright, you done c# before?
oh this is gonna be a learning curve
yeah haha
any other programming languages?
lemme give a short lesson to explain in OOP terms
public int MyInteger;
private int MyPrivateInteger;
the difference here is that the private one can only have its value changed by code inside the same file its in
Yeah I know how Private and Public data works
as well as Integers/Variables in general
sorry, I probably should’ve mentioned that
okay, in unity though, when something is public, the actual inspector area creates a field you can edit for it
a great example here
[Range(0, 1)] public float myRange;```
screenshot?
uhh
win+shift+s if you dont know the fast screencap trick
then just paste, no need to save it
click on the object in your sceneHierarchy
oh the Player?
(i just wanted to see if you were looking in the right place)
yup
then you will see the player script has a new box on it
you can drop the scriptableObject into that box
yeah, has the player got a script?
Yes
can i see the inspector for PlayerMovement
well, the inspector for the player, where the PlayerMovement component is attached
nope, thats the script itself
i mean the player
but its attached PlayerMovement component
also thank you for being so patient with me, I must be infuriating to deal with
Oh that
yes
this is where you choose which ScriptableObject you want to attach
the players own ( movement scripts own ( speed ScriptableObject ) )
does that make sense?
yes
Idk if I should mention this, but I made the scriptable object in a different script
not in the PlayerMovement
thats exactly its purpose
think of a scriptable object as a set of alternate settings for things
Ok
like if you make a generic playercontroller that depends on a bunch of settings, and are building a clone of overwatch, for example, each character can have its own ScriptableObject to make them unique
its not the way id go about it in production code, but i think the concept makes sense
so they all share move speeds and such, rather than manually setting them all?
NPCs and playerCharacter, i assume
They share the same data types, I was using the scriptable object to change them between classes
So for example
One class is Leaper
They have a normal speed
but a high jump height
and another one
is Speedster
they have a normal Jump Height
but high speed
i was trying to use the ScriptableObject to change the values with each character
if that makes sense
if its just values you are going for, you could probably have gotten away with a static struct
oh, sorry
no problem you just beat me to the same point lol
but yeah, for values its minor overkill, but its never a bad idea
you can always expand the functionality without needing to overhaul any designs
excellent for 2 hours of work tbh
i know paid people who dont do this
So if I was just trying to make each class have a unique set of variables, would I use a ScriptableObject or no?
Thanks man! That means a lot coming from you!
np!
scriptableObject is ok, but its mostly for actual functionality
for instance, we could just use a struct to handle the data here perfectly fine
in overwatch, each characterClass has its own special ability right
yeah
ohh
i get it
for actual functions and unique things that aren’t shared between players
in this case, yeah, we can ask a ScriptableObject to do its "special"
you want a ScriptableObject
each version of that ScriptableObject can have its own functionality for its own special, its a neat thing
That makes so much more sense
uh, would you mind me asking how to make a struct?
if you aren’t busy ofc
a struct is like a class
except its not got an actual object attached to it
any and all methods it has are static
struct MyStruct
{
int aValue;
int anotherValue;
}```
so would I just be able to add that under the public class, and place my variables inside of it?
you could
but
public struct PlayerMovementData
{
// . . .
}
public class PlayerMovement : MonoBehaviour
{
//. . .
}
they can also replace classes entirely
oh?
it doesnt do anything, its not an object, its RAW data
that seems like it would have a lot of potential tbh
a pure data structure which can be accessed anywhere pretty much
public struct PlayerMovementData
{
// . . .
}
public class PlayerMovement : MonoBehaviour
{
PlayerMovementData MyPlayerMovementData;
}
you can create a whole .cs file for a struct if need be
its worth having a look on yt for info on them
they are insanely powerful
So if I wanted the datasets for all of the classes (5)
i would just put a struct above the public class with the data
you dont pass a reference to a struct by default, its always copied
and then call it down?
not above
where would the position be?
in its own file, i put them one above the other to show that the scope is the same as a class
yeah i guess so, though once you delete : MonoBehaviour and replace class with struct it is no longer a script, its just a file with some data
heres a good example of a struct
alright so if I’m following correctly:
I make a C# script in unity
Make a struct
Fill out with the data of each class
Then use that in PlayerMovement?
struct Coordinate
{
public int x;
public int y;
}```
you can create it with static variables if need be
this is the approach you are likely going to need
statics just exist for everything with access to that file, as if they were carved in stone
struct playerSettings
{
public static float PlayerSpeed = 10f;
}```
you are also able to make structs that dont have a value already, youve likely used them in other places
Not through like clicking and typing a different number
but how would I be able to make the speed of one character different to the speed of another
here
struct Coordinate
{
public int x;
public int y;
public Coordinate(int x, int y)
{
this.x = x;
this.y = y;
}
}```
now in any script you can do this
int myX = 10;
int myY = 10;
Coordinate MyCoordinate = new Coordinate(myX, myY);
this way you can share the type called Coordinate between any file
I’m not following 😓
so for instance, each character would need a PlayerSettings
but you can also have another file which stores ALL settings
its all part of the learning process, just figuring out what you like tbh
yeah
its never a bad thing though to just have a monoBehaviour with some floats on it attached to a gameObject
at least you get a nice menu
its all up to you on that front
alr so I have a question
yeah whats up?
if I used a static with the datatables
Would I need to make a whole new variable for each character
like
if I wanted just a general speed variable that changed with each character, how would that be accomplished??
if you made a struct with static, hard coded values, just pretend that unity reads that file like you do
with each character?
yeah so each character/class has a different speed
do you mean they all share speed? or they all share behaviour and have their own speed
the monoBehavior isnt static
Alr may I explain some stuff to make sure we’re on the same page
if you drag that script onto 5 different gameObjects, you can set it up in 5 different ways without it conflicting
like i can make a script for jump, attach it to 3 characters, and give them individual jump heights just by changing the value in the inspector
per gameObject
are they though?
its a class
a class means classification, a little factory that creates an object of its own
by using it in 5 different places, you get 5 different object instances in memory
I want a class system with 5 roles that have different and individual stats like speed, jumpingPower, etc.
The Player uses the same gameobject with each role.
so how would I make this one GameObject change its data
when you use a different role
lets say role or profession instead of class, its a little confusing lol
Yeah, role
okay so we can make a Role as an actual file
or at least the factory that describes what a role is and lets you create one
I’m just using a gameobject with a player controller that changes its sprite with a script
struct Role
{
float speed;
float weight;
float jumpHeight;
}```
not exactly, but something similar, right?
Yes
I don’t use a weight system
but the other two are there
Alright I have that typed in
What do I do next
well your also going to need a character as well, so your character can have its own Role
this may have been the perfect spot for the scriptable object, like i say, this is entirely down to how you want to build your game
the CharacterManager has a variable that tells everything which role you’re currently playing as
would that work?
oh jesus I’ve been here for a while
maybe? im not entirely sure on the full architecture of the project
so if I just have a struct that has each variable
and it knows which character it is
how do I make it change the variables
Gods i feel like a broken record XD
character.speed = myArcherStruct.speed
myArcherStruct is just its own Role
Role MyArcher = new Role(define variables here)
the manager could have some scripts on it that lets you tweak those values if you want to approach it like that
using UnityEngine;
struct Character
{
float speed;
float jumpHeight;
}
role
its not the character itself, just the values a role can actually modify
is "using unityEngine" greyed out for you in the text editor?
No
huh
strange, never would have expected a struct to require the unityengine
its just raw data
ok so how do the variables change
youre creating a type
yes
just like a vector3
ok..
so a role is no different to a Vector3 really, you can set its values in code wherever and whenever you please
ok so
in my PlayerMovement Script?
if you have a script that manages your character roles, use that maybe
alr I do
then you can go ham on declaring as many roles as you like
so ill put it in that
then each character can ask the manager file for the role it needs
global scope
class RoleManager : MonoBehavior
{
Role RunnerRole;
Role JumperRole;
Role ChefRole;
}```
thats global scope
any method can access it
now you can use the RoleManager file to make a little menu in the inspector that lets you pick each value for each role
where’s the role manager file?
this
you know this is all ideas on how you could solve the problem right?
what?
youve got to architect and figure out a neat solution, im just explaining how you can hook the things together
yeah ofc
okay so RunnerRole.Speed = someValue
you can now have the character ask roleManager for RunnerRole.Speed
the RoleManager can have public variables for each speed
thats all there is to the roles
Where do I add this
that works perfectly for me
but
where do I add that
last tidbit
class RoleManager : MonoBehavior
{
public Role RunnerRole;
public float RunnerSpeed;
public float RunnerJumpHeight;
public Role JumperRole;
public float RunnerSpeed;
public float RunnerJumpHeight;
public Role ChefRole;
public float RunnerSpeed;
public float RunnerJumpHeight;
void Start()
{
RunnerRole.Speed = RunnerSpeed;
etc...
}
}
Thank you
now a character can have a reference to the RoleManager and ask it to provide RunnerRole.Speed
its not the cleanest way around things, but it should make things clear enough that rebuilding or redesigning the solution wont be such a pain down the line
but, for a few hours in, were not building google
yeah, ofc
this is kind of a small project XD
I’m pretty sure just about every article in the world says never to start with a big unity project
im doing something similar, i did have a character controller built, but im breaking it all up into tiny scripts that handle JUST the things they are asked to
its a good convention to name behaviours as behaviours
ill get an example of my stuff up
Cool!
move state manager is interesting, it chooses which movement script to use depending on what the character is up to
those scripts can tell the behaviour scripts when or if to behave
or how
the idea is, when grounded, the state becomes this
these scripts handle each state
Ohh so it uses multiple smaller scripts
its always a good idea to break things down into small components, rather than handling everything in one place
yes, and it avoids me nesting "if if if"
which also avoids making bugs super easy
when im in the air, the ground detector naturally fails to find ground, it reports to my MoveStateManager that there is no ground
wait how does it detect the difference between Air and Jump states?
the MoveStateManager then switches to AirBorne and relies on MoveStateAir for its Update and FixedUpdate Methods
public class MoveStateAir : MoveBaseState
{
public override string Name
{
get { return "Move State Airborne"; }
}
public override void EnterState(PlayerMoveStateManager context)
{
Debug.Log("Move State Entered: Air");
base.EnterState(context);
}
public override void ExitState()
{
Debug.Log("Move State Exited: Air");
}
public override void UpdateMovement()
{
if (GroundDetectBehaviour.GetGroundState() == GroundState.air)
{
if (!GravityBehaviour.GravityEnabled)
{
GravityBehaviour.EnableGravity(Context);
}
}
else
{
Context.SwitchState(Context.GroundedState);
}
}
}```
the air state just asks the ground detector if its grounded, if it is, then it asks context (the manager upstairs) to switch to ground state instead
damn dude
and the reverse applies for not being grounded anymore, switching to airborne
on and off for about a decade
wow
im not a wizard by any means, this code is simple so I dont get confused
this is a cool thing you can do with object oriented code tho
using UnityEngine;
public abstract class MoveBaseState
{
public abstract string Name
{
get;
}
private PlayerMoveStateManager _context;
public PlayerMoveStateManager Context
{
get { return _context; }
}
// Behaviours
public GroundDetectBehaviour GroundDetectBehaviour
{
get { return _context.GroundDetectBehaviour; }
}
public GravityBehaviour GravityBehaviour
{
get { return _context.GravityBehaviour; }
}
public virtual void EnterState(PlayerMoveStateManager context)
{
_context = context;
}
public abstract void ExitState();
public abstract void UpdateMovement();
}```
you can describe an abstract class
its essentially a blueprint that forces other classes to be like itself
whats an Abstract class?
if it doesnt fit the blueprint, visual studio AND unity lose their shit
like when you say MyClass : MonoBehaviour
well here, im doing the same
MyMovementState : MoveBaseState
virtual voids MUST be replaced
abstract voids CAN be replaced
heres where it gets similar to your role system
public class PlayerMoveStateManager : MonoBehaviour
{
public string currentStateName;
public MoveBaseState currentState;
public MoveStateIdle GroundedState = new MoveStateIdle();
public MoveStateJump JumpState = new MoveStateJump();
public MoveStateWalk WalkState = new MoveStateWalk();
public MoveStateAir AirState = new MoveStateAir();
...
...
private void FixedUpdate()
{
currentState.UpdateMovement();
}
public void SwitchState(MoveBaseState state)
{
currentState = state;
currentState.EnterState(context: this);
currentStateName = currentState.Name;
}
see how my SwitchState wants the MoveBaseState?
i can give it a JumpState, or a GroundedState
they count as MoveBaseStates
mine are functional, rather than data, thats the main difference#
yeah, its a state machine
each state is a file, each one has its own version of UpdateMovement
and each one has a little function that runs once when its been switched to
sure
or use the movement script you have
Oh ok
make a gameObject reference, like "public GameObject MyRoleManager"
then in the unity editor, drop the role manager object on the character
now, in any way you like, have the movement or character script, whatever you decided to use, go like "speed = MyRoleManager.RunnerRole.Speed"
make sense?
youve now got a place where all the role values are stored, and can be accessed by any other gameobject
like
if (MyCharacterIsARunner)
{
//set your speed here or something
}```
which method would I do
like start, or update, if you are able to change roles mid game
or make a new one called "ChangeRole(Role MyChosenRole)"
actually thats probably the best way to do it
wait so what
what method do I place this under?
if I don’t want changeable roles mid game
void ChangeRole(Role ChosenRole)
{
Speed = ChosenRole.speed;
JumpHeight = ChosenRole.JumpHeight;
}```
its own method
Ohh ok
then in start you can hard code the role you want for now and worry about a decent way to switch later on
void Start()
{
ChangeRole(RoleManager.RunnerRole);
}```
so when the script starts, it runs the changeRole function, it asks the RoleManager we made a reference to for the values from RunnerRole, then ChangeRole sets your characters Speed and Jump Height to those values
ok that makes sense
the RoleManager can just be an empty gameobject in the scene at 0,0
i do the same thing for input too
I should just be able to drag it into the hierarchy tho right?
K
its just a position with nothing else on it
it has no hitbox, no physics, nothing, just a position value, which is a good idea to set to 0,0,0
now add your RoleManager script to it
Done
now your character, it will want a reference to that object
that is the reference
so, like my player wants a reference to the inputManager
did you make one?
make what
in your character public RoleManager MyRoleManager
in my character script?
oh yeah that lol
now save the script, go back to unity, and drag the RoleManager Empty we made earlier and drop it onto the box that shouldve appeared on the character's movement script
was I supposed to add that?
I did that and I still dont see a box
im sorry for being such a hassle my mans
im trying to be quick but I’m not that great at this
see here?
in my PlayerMovementStateManager, i have a line that says public GameObject InputManager
it makes the box appear, then i go into unity and drop a gameobject, which ive aptly named InputManager
go back to VS and hit Save all
was that public GameObject MyRoleManager in the player movement file?
Yeah
huh
i have two
whats the compiler errors?
i have the gameobject one
wait why two?
and the public RoleManager one
oh delete the one thats not the gameobject that was communication error
the compiler was probably like "what the hell is a RoleManager"
Yeah
double click the error
Im alr in SkinManager
is Role public?
is speedster public
yes
something says it isnt
where’s “Speedster”
double click it so it takes you to the exact line where it dies, screenshot it and lemme see
Ok
fixed it?
theres no red squiggly lines?
I don’t see any
any errors in VS?
when i asked if role was public i meant this
public struct Role
{
//...
}```
make the whole file public
should resolve it
wait where are we putting struct?
shouldve probably been clearer lol
the role file we made ages ago
Yea
yeah its probably the issue, should fix things
oh i believe it, i just asked and took "yes its public" for an answer and was stumped til i realized you probably meant a reference to it lol
those errors btw, they are super common phrases, dont be shy at just typing the whole error into google
99% of the time it just fixes everything
theres only a couple but on repeat
True
bc you have multiple roles ofc
So whats causing this
check in VS not in unity
I am
its error list is way more powerful
wheres that?
"does not exist in the current context" means you dont even have a variable with the name
like you just didnt make it, but you are asking for data from it
is that visual studio, or visual studio code?
okay thats VS
VSCode is its own special thing and doesnt come with much help for unity
are you in the file that its complaining about
i am
no i was just checking you had the right thing installed
oh ok
in unity, double click one of those context related errors then
see where it takes you
PlayerMovement
to the exact line
i was in the wrong one 😑
it doesnt just open a file, it opens to a line
ok hold on
it puts your caret on the bug itself
No
then unity is talking crap
clear the error list in unity again
is the game running?
save ALL files and reboot bot unity and VS bc this shouldnt be happening unless something is talking crap
if these are new errors, lets see them
screen first, lets see if we cant make sense of why unity is throwing a fuss over nothing
oof
this is just how software dev is
how fun
over time you will get to know what each error really means and how to hunt them down super quick
hopefully lol
when i see "doesnt exist in the current context" i always think "yep, i know, i didnt write float x; at the top of the file, thats why x is crying"
Ok so i have different variable names for speed and jumpheight
Im just gonna match them all up
change the ones at the top of the file to match the ones i wrote
?
public stuff should always BeLikeThis and private stuff should beLikeThis
and local scope private stuff should _beLikeThis
Ok do you need a screenshot or anything
thats not a code error, thats just a bit of grammar so you know what you are reading without having to scroll all the time
SprintHeld = playerControls.Default.Sprint.IsPressed();
JumpPressed = playerControls.Default.Jump.WasPressedThisFrame();
CrouchPressed = playerControls.Default.Crouch.WasPressedThisFrame();
CrouchReleased = playerControls.Default.Crouch.WasReleasedThisFrame();
Vector2 _movement = playerControls.Default.Move.ReadValue<Vector2>();
Vector2 _padLook = playerControls.Default.GamepadLook.ReadValue<Vector2>();
Vector2 _mouseLook = playerControls.Default.MouseLook.ReadValue<Vector2>();
if (_movement.magnitude > LeftStickDeadzone)
MoveInput = _movement.normalized;
if (_padLook.magnitude > RightStickDeadzone)
LookInput = (_padLook * new Vector2(StickSpeedHorizontal, StickSpeedVertical)).normalized;
else
LookInput = _mouseLook * new Vector2(MouseSpeedHorizontal, MouseSpeedVertical);```
like this stuff, i declared _movement inside my update function, so its lowercase and has an underscore
Yeah ok so everythings matching
MouseSpeedVertical is a public global
I think
i know why though
i removed the original speed and jumpheight variables
let me
readd them
yup i thought that was the case, i was trying to see if i could get you to find your own missing variables
i dont wanna just say "its this"
yeah, helps me actually learn
id rather show you how to debug something and understand the error in front of you
thank you man
np
Most people wouldn’t even put in that much effort
would you mind if I friend requested you?
im just sat with tunes on drinking a coffee
not to weird lol
i mean if you like, sure
Ok so I added those variables
A lot of them are gone
what are the leftovers looking like?
good idea
okay easy, all of the "does not exist in the curren context" issues are identical to the one weve just solved
for all the current context ones, just double click and then create that variable globally
and the Role.JumpHeight
It was because I didn’t have them all matched up
it has an issue with access levels
so something is public and something else isnt, and its causing a conflict
Ohhh
so make all the variables inside that struct file public
Ok
it also looks like its saying the struct doesnt have a variable called speed
whats the struct file look like now
hold up
Yeah?
if they are being referenced in more files than just that one, which they are, theres a better way]
right click the name and rename
then type it with the capital
it will apply that name across any file that references it, so no bugs appear
I don’t see that button
gone green?
“the key combination (Ctrl + R, Ctrl + R) is bound to command (.Refactor.Rename) which is not currently available.”
thats what it says
weird
nope
a side thing for organizing code btw
#region Input Settings
[Header("Stick Settings")]
[Range(0, 1)] public float LeftStickDeadzone;
[Range(0, 1)] public float RightStickDeadzone;
[Header("Stick-Look Settings")]
public float StickSpeedHorizontal;
public float StickSpeedVertical;
[Header("Mouse-Look Settings")]
public float MouseSpeedHorizontal;
public float MouseSpeedVertical;
#endregion
#region Accessors
public Vector2 MoveInput
{
get; private set;
}
public Vector2 LookInput
{
get; private set;
}
public bool SprintHeld
{
get; private set;
}
public bool JumpPressed
{
get; private set;
}
public bool CrouchPressed
{
get; private set;
}
public bool CrouchReleased
{
get; private set;
}
#endregion```
use #region NAME and #endregion
in unity
Oh yeah
click on the RoleManager
yeah
the roleManager is where you dun dun dun, manage your roles
this is the pro tip i was showing
you can make regions and fold them away
did you actually made a speed for the role you want
lol
Or the script at least
yeah remove component on that
the role manager object is global so that any character can talk to its role manager script from the scene
yeah, its likely youve got the move speed data working fine now
but also not moving the player at all
if you make the move speed on the player public, you can see what its value is in the inspector and see if its getting 0
this is how i usually debug
temporarily make things public and see what they do
well, in the role manager, what are the speeds set to
your character has a role picked, right?
lets say, runner
nope
thats only if im doing something like x += 0.5f
Here let me send you the code
speed is 0
Its under
public class PlayerMovement : MonoBehaviour
what line
17
copy paste the code into here
Not the error
the screenshot
Thats what determines it
its white
that’s probably bad
no thats fine
no
true
thats already declared globally
yup
it probably is
But it says it isn’t
add a Debug.Log(ChosenRole.Speed); to that void
It doesn’t say anything
so you arent actually running that method at all
what about the start method
run the method
what start method?
So do i just
replace the first chosenrole
with start?
Ok so
so when the game starts, this method kicks off
you will need to pass in the role you want to start with as well
What do I put where it says “ChangeRole();”
void Start()
{
ChangeRole(RoleManager.RunnerRole);
}```
Oh am I writing this
when the game starts, the character changes its role to the RoleManager's Runner Role
or whatever role you want it to start with
yeah pretty much thats it
the Start method runs once when the object its on, the character, is loaded
double click it
wheres it taken you?
hm