Skip to content
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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Vhostym
Copy link
Collaborator

@Vhostym Vhostym commented Feb 26, 2021

No description provided.

Commit to handle having the ghost activate checkpoints while in spectator mode. Currently not functioning.
@Vhostym Vhostym requested a review from ambid17 February 26, 2021 05:48
@Vhostym
Copy link
Collaborator Author

Vhostym commented Feb 26, 2021

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>();
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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>();
Copy link
Collaborator

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

Copy link
Collaborator Author

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).

@Vhostym Vhostym marked this pull request as draft March 12, 2021 02:18
@Vhostym Vhostym self-assigned this Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants