Jump to content
  • Advertisement

Recommended Posts

I need help on a script. I am recreating a scene from A Hat In Time where Hat Girl goes into Queen Vanessa's manor. She has to collect keys and avoid Queen Vanessa. How would I script the door where you can open it and peek through it without actually going out the door? Any help is appreciated. Thanks!

EDIT: Not peeking throught the keyhole, just poke your head out the door

Share this post


Link to post
Share on other sites
Advertisement

Are you modding the game or recreating something using an existing engine that you're not totally familiar with yet?  We'll need to know what exactly you're dealing with to offer more detailed suggestions.

Edited by Nypyren

Share this post


Link to post
Share on other sites
2 minutes ago, Nypyren said:

Are you modding the game or recreating something using an existing engine that you're not totally familiar with yet?  We'll need to know what exactly you're dealing with to offer more detailed suggestions.

I am recreating a set of actions from Unreal Engine to Unity 

Share this post


Link to post
Share on other sites

Normally with a door, you'll either move the collider with the moving part of the door, or just disable the collider at a specific point.  You can use an animation to open the door or use physics and apply force or torque to open it.

With the door that you only want the user to peek through, you'll probably want to use an animation to control the door.  Don't do anything with the collider; just move the rendered mesh so that you can actually see through/around it.  Put the player into a state where they can only perform actions you want them to, or cancel peeking.

I can't quite tell from your posts, but just in case you haven't done any scripting in Unity yet, it would be best to start by reading/watching all of the online tutorials that are available first.

Share this post


Link to post
Share on other sites
2 hours ago, Nypyren said:

Normally with a door, you'll either move the collider with the moving part of the door, or just disable the collider at a specific point.  You can use an animation to open the door or use physics and apply force or torque to open it.

With the door that you only want the user to peek through, you'll probably want to use an animation to control the door.  Don't do anything with the collider; just move the rendered mesh so that you can actually see through/around it.  Put the player into a state where they can only perform actions you want them to, or cancel peeking.

I can't quite tell from your posts, but just in case you haven't done any scripting in Unity yet, it would be best to start by reading/watching all of the online tutorials that are available first.

I have scripted before

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!