Forum rules - please read before posting.

How to create a moveable door with handles?

Hi, 

I have been following the "Making a moveable door" tutorial here : 

https://adventurecreator.org/tutorials/making-moveable-door

I've managed to reproduce the door in the tutorial and it works well.

However, I'd like my doors to have handles rather than the whole door being the draggable object.

I have gotten as far as adding two small colliders, one for each handle, which works as expected with the handles being grabbable but my player is then able to walk through the door object because it has no collider covering it's area. 

Is it possible to add another collider that prevents the player walking through the door but does not get picked up by Adventure Creator as being a grab point? Ideally the player walking into the door would push the door around also.

Any tips would be greatly appreciated!

Thanks,
Sam

Comments

  • Welcome to the community, @samfozz.

    Any Collider on the Draggable object will react to mouse clicks if it is on the Default layer.  If you want to have the door react to physics but not to the mouse, place it as a separate child object on the Ignore Raycast layer.
  • Ooops ... I duplicated my post as I didn't notice the system tell me the post was awaiting moderation and assumed it had not been submitted properly :s
  • Hmmph, the reply’s I tried posting here previously seem to
    have gone into some sort of moderation black hole… Something to do with using
    hyperlinks maybe.

    So I’ll just quickly post a paraphrased version here for
    what it’s worth:

    This does disable the ability to grab the door, which is good,
    but the new collider still seems to have some side effect on the draggable object,
    causing it to go all wonky as you open the door.

    Is there a way to instruct Adventure Creator to ignore the
    collider completely? Or is the intended behaviour of having the collider on a different
    layer?

  • The two colliders will need to be on separate layers if you only want one of them to be "interactive" in the mouse-clicking sense.  Unity requires that each object is on a single layer, so in order to do that you will need to have them be on separate GameObjects.

    This sounds like a Physics issue, in which case it may be something you can configure in either the Rigidbody component or Edit -> Project settings -> Physics.

    Unity also allows for two layers to ignore each other when it comes to physics.  After backing up your project, try moving the larger door collider to a new layer (e.g. "Door"), and create a new dedicated "Hotspot" layer for interactive objects.  Enter this name into the "Hotspot layer name" at the bottom of the Settings Manager, and Hotspots should then be placed on that layer automatically.  You should then be able to use the Physics settings to ignore collisions between Door and Hotspot.  Since I haven't tested that myself, I'd recommend keeping a backup in case it doesn't work.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.