-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality for ghost to activate checkpoints and remove collectibles in spectator mode #318
base: develop
Are you sure you want to change the base?
Conversation
Commit to handle having the ghost activate checkpoints while in spectator mode. Currently not functioning.
Note, still a work in progress. Checkpoints don't seem to be activating right now, and I'm debugging as to why. Haven't started work on collectibles yet, as they would encounter the same issues as checkpoints. |
private void OnTriggerEnter(Collider other) | ||
{ | ||
Debug.LogWarning("Collider triggered by ghost"); | ||
Checkpoint checkPointHit = other.gameObject.GetComponent<Checkpoint>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably want to use "gameObject.tag == "checkpoint", as getting components is relatively slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.comparetag and unsure if its faster than getcomponent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significantly
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
ghostController = GetComponentInChildren<CharacterController>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there even a characterController on the ghost prefab? there shouldn't be. just a capsule collider needs to be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Unity help sites I was checking seemed sure that I needed a Rigidbody in order for triggers to function correctly. And charactercontroller was the easiest way to do that. I initially was working without one but couldn't get my triggers to go off (granted they still aren't working, but I'm trying to figure out what's happening).
No description provided.