-
Notifications
You must be signed in to change notification settings - Fork 370
Add toggle noclip console command #2277
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
Conversation
There's a few different ways that I can think of to add tcl, this solution is however the most generic that doesn't require too deep changes to for example CharacterController. |
Hey there and welcome. :) There are a few changes in here unrelated to your PR (e.g. whitespace). Could you please clean these up and resubmit with just the required changes? I'm not confident about using collider radius to create this effect. It should be adequate just to disable collider when noclip is enabled, and enable again when noclip disabled. There will also be some conflicts if player has previously used "tgm" or "levitate on" commands. This implementation doesn't cache their previous state when noclip is enabled, so might improperly disable them when noclip is disabled. And what if player changes "tgm" or "levitate" state while noclip is enabled? I'd have to play with this and see if there's a way to implement that doesn't trip up other console commands. |
Hi and thank you. :) You're right about the white space, this was more of a draft to get something in - I wanted your opinion. Well, I am not confident either, but it seems you can not disable the collider in any real way without editing the character controller script. (Or temp disabling it and enabling another noclip controller... maybe that's a better way?). Regarding, the console commands yes it's not considering tgm or levitate's prev/curr state - I thought it didn't matter to much though, and it should be fine to remove both of those changes but I was afraid the infinite radius may cause issues with health/insta-death if not god mode was enabled. Anyway, I will keep looking into it as well and maybe play around with the noclip controller idea, I just didn't want to impact too much with my first commit here! haha :) |
Add a new layer that will ignore collissions
Hi :) @Interkarma I had an idea that we could add a new Noclip layer, which then the controller could be put in. This would solve the issue - even quite neatly. However, I don't know how to add a layer to the unity project. (As in so it's visible in git. I only saw it updated in artifacts) I also cleaned up what you requested earlier. Ah and uh.. Ignore my failure to deal with git. |
No problems here with switching layers to ghost player collisions. I'm happy to add noclip layer into core as part of merging PR.
You're right, probably not a big deal for console commands. I'll just need to play with it a bit to be sure and merge when I can. Cheers! :) |
I'm working towards another point release. I probably won't get this merged just yet, but I will loop back to this soon. Thanks again for tweaks. :) |
That's fine, is there anyway I can assist you or contribute? |
After testing, I'm happy with this approach and using new "NoclipLayer" with physics matrix set as you describe. There's also no problems setting levitate flag on/off, so this can be added back. My earlier concern was this might disrupt levitate effect as it uses same IsLevitating flag. But effect sets this continuously in ConstantEffect, so this won't be a problem at all. Edit: BTW, I'm happy to create new layer and set collision matrix in project after merge. Just the code changes are fine. Cheers! :) |
Hi, I have fixed these changes. :) |
Completing PR #2277. Add NoclipLayer to list of layers. Set layer collision matrix to ignore collisions entirely on NoclipLayer. Player is placed in and out of this layer when tcl toggle is called. Fix null checks in command code.
This is the "simplest" method,
but a bit hacky - hence experimental.