NicolaeChristof / Rise

Repository for 17X project
2 stars 0 forks source link

Implement mechanics for different branches. #63

Open malcolmriley opened 5 years ago

malcolmriley commented 5 years ago

Ideally, this will be implemented as a number of prefabs, wherein common behavior is implemented in a scripts for the simple type, and specific behavior is implemented via a script inheriting from that base type.

malcolmriley commented 5 years ago

We've got a bit of an issue on our hands regarding the current Squirrel player movement implementation. Here's the breakdown:

The fundamental issue is that the current Squirrel movement implementation is incompatible with physics.

The current workaround is to attach a second capsule collider to the Squirrel, and a kinematic Rigidbody that doesn't respond to gravity (Since we can't use physics on the Squirrel), as well as secondary trigger-only colliders on the branches. Thus, the branches can respond to Trigger collision events without interfering with the way the Squirrel's movement works currently. Only time will tell if this is ends up being an effective long-term solution, so I'm documenting my reasoning for it now so that when we all forget why everything was the way it was we can look back and hopefully piece it all together again.

NicolaeChristof commented 5 years ago

Thank you for looking into this.

First: I would like to use your "secret third flavor" of collision detection because it means we can keep our existing character controller code. All of my playtesters said that the player controls feel very solid and I dont want to backtrack and lose that.

Second: when I was building the character controls I looked into and tried using a ridgidbody but it didnt "feel" right and I ended up using the character controller because of this.

Therefore I think there are two ways we can go about this.

1) I think an alternative would be to create a new script and attach it to the player and access the character controller through this to do our physics. It would be using your "secret third flavor" but also keep branch logic in its own file without interfering with the player controller script.

2) alternatively if you want to keep the scripts attached to the branch prefabs you could theoretically access the player from the scripts on the prefabs

if you have questions or wish to discuss this you know how to reach me :)

malcolmriley commented 5 years ago

Well, I think it would probably be possible to recapture whatever magic we have using the CharacterController with a physics-based approach but then again I haven't actually tried it, so maybe not.

Compromise counterproposal:

Pros:

Cons:

Not ideal in my opinion, but then again, is anything ever?