Announcement

Collapse
No announcement yet.

Look at door to trigger it to open, whilst inside it's Trigger volume, leaving other doors closed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Glad to have helped!

    Leave a comment:


  • replied
    That worked perfectly!

    The gate was also giving me some trouble so I got rid of it all together as I couldn't get the "Close" to trigger properly for whatever reason. I went down to the two variables you suggested in the Doors blueprint, "isOpen" & "isPlayerInVolume". The Raycast triggers the OpenDoor function but that gets blocked by a branch using isPlayerInVolume, which goes to another branch to make it stop if "isOpen" is true. Entering the trigger volume sets isPlayerInVolume to true and nothing else. Exiting the trigger volume sets isPlayerInVolume to false, checks to see if isOpen true and if it is, waits 3 seconds then closes the door.

    Now all the doors seem to work and I've not had any odd behaviour. Thanks again!

    Leave a comment:


  • replied
    On your line trace, replace that with a 'LineTraceByChannel'. This will return a single actor that you hit. Take the 'OutHit' pin, drag it out and drop it. Select 'Break Hit Result' from the context menu, and look for 'Hit Actor'. Cast this to your door. If the cast works, call Open Door on that door. Beyond that, you're also making your logic more complicated than it needs to be. You can remove the top line entirely in the second picture, and you can replace all your booleans in the top with 'isPlayerInVolume' and 'isOpen'. This should solve your issue and also make it so that you can work from here. Oh, you also need to close that gate at the top.

    Leave a comment:


  • Look at door to trigger it to open, whilst inside it's Trigger volume, leaving other doors closed

    I'm building a scene to be used with a Samsung Gear VR and I'm having some trouble getting my doors to work the way I want them to. Because of the lack inputs on the headset the idea is that the user will simply look at a door for a second or two and if they are close enough the door will open. Then once they leave the trigger volume around the door, after a few seconds it will close again.

    I've got this working using the system below but I'm having problems when I place multiple versions of that door. I'm guessing the problem is because I'm not telling the character blueprint which specific door to send the "OpenDoor" command to. I'm a complete beginner when it comes to this so I don't really know where to go from here, could someone help?

    When I've only got one door in place this system works fine, but once there is more then one the doors start behaving strangely. Some never open, some open and close when entering the trigger volume of a different door.

    Here is the blueprint for the door:

    Click image for larger version

Name:	Door_single.jpg
Views:	1
Size:	785.0 KB
ID:	1167162

    Off the edge is the timeline and rotator to actually move the door.

    Here is the Raycast section, I've added this to the standard First Person character blueprint:

    Click image for larger version

Name:	Firstperson_blueprint.jpg
Views:	1
Size:	808.5 KB
ID:	1167163

    I'm pretty sure the problem is that I'm sending the "OpenDoor" command from the player to all doors as opposed to the specific door being looked at, but I wouldn't know how to define that. Can anyone help?

    Thanks
Working...
X