I have a problem with the doors when they open and then I'm waiting for them to closeThere is already an open DataReader associated with this Command which must be closed firstunity OnTriggerStay2D() for two triggersOnTriggerExit2D () doesn't workUnity GUIText on Collision c#Wandering AI in unity C#How can i use animator parameter to control door open/close speed?Animating a child object in unityWhy when adding a Rigidbody to a door and Is Kinematic is enabled true on the door open automatic when running the game?How to convert keyboard controls to touch screen in UnityHow can I find all the doors getting null exception?
Does malloc reserve more space while allocating memory?
Why did the EU agree to delay the Brexit deadline?
Does IPv6 have similar concept of network mask?
Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?
Angel of Condemnation - Exile creature with second ability
Lowest total scrabble score
Plot of a tornado-shaped surface
Why is it that I can sometimes guess the next note?
What if a revenant (monster) gains fire resistance?
Does Doodling or Improvising on the Piano Have Any Benefits?
Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?
Pre-mixing cryogenic fuels and using only one fuel tank
How should I respond when I lied about my education and the company finds out through background check?
Why should universal income be universal?
Biological Blimps: Propulsion
Is there a RAID 0 Equivalent for RAM?
Why is this estimator biased?
What is the highest possible scrabble score for placing a single tile
Has any country ever had 2 former presidents in jail simultaneously?
Need help understanding what a natural log transformation is actually doing and why specific transformations are required for linear regression
Why is the "ls" command showing permissions of files in a FAT32 partition?
15% tax on $7.5k earnings. Is that right?
How much character growth crosses the line into breaking the character
How to fade a semiplane defined by line?
I have a problem with the doors when they open and then I'm waiting for them to close
There is already an open DataReader associated with this Command which must be closed firstunity OnTriggerStay2D() for two triggersOnTriggerExit2D () doesn't workUnity GUIText on Collision c#Wandering AI in unity C#How can i use animator parameter to control door open/close speed?Animating a child object in unityWhy when adding a Rigidbody to a door and Is Kinematic is enabled true on the door open automatic when running the game?How to convert keyboard controls to touch screen in UnityHow can I find all the doors getting null exception?
Once I'm entering the trigger area the door open.
If I'm staying inside the trigger area after the doors opened after some seconds the door will close on me. But in my logic the doors should be stay open as long as I'm inside the trigger area. The door should be close start closing only when leaving the trigger area.
Another problem is if I'm moving inside/outside the trigger area of the door too fast. Once I'm in the door start open when the door is opened if I will move back out the trigger area fast and move back in very fast again even if the door is still open it will play the open door animation again. I'm not sure how to solve this too fast entering/exiting problem.
I think the logic should be very simple.
Entering the trigger area open the door.
If I'm staying inside the trigger area while the door is opened finished open don't close the door ever until I'm exiting the trigger area then take some seconds and start closing the door.
If the door started closing and I'm then entering the trigger area again open the door at the point where the door is now even if it's in the middle of closing.
If I'm quick very fast entering/exiting the door trigger area keep handle it like in the first two rules. And don't play the open door animation if the door is already finished open and opened already. What if the play is running ?
The Doors Manager script is attached to a empty GameObject:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorsManager : MonoBehaviour
public List<HoriDoorManager> _doors = new List<HoriDoorManager>();
private void Start()
var doors = GameObject.FindGameObjectsWithTag("Door");
foreach(var door in doors)
_doors.Add(door.GetComponent<HoriDoorManager>());
public void LockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(true);
public void UnlockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(false);
The script Hori Door Manager is attached to the door child name Horizontal_Doors_Kit:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HoriDoorManager : MonoBehaviour
private bool doorLockState;
private List<DoorHori> doors = new List<DoorHori>();
private void Start()
if (transform.parent != null)
Transform parent = transform.parent;
var children = parent.GetComponentsInChildren<Transform>();
if(children != null)
foreach (Transform door in children)
door.name == "Door_Right")
doors.Add(door.GetComponent<DoorHori>());
void OnTriggerEnter()
if (doorLockState == false)
if (doors != null)
for(int i =0; i < doors.Count; i++)
doors[i].OpenDoor();
public void ChangeLockState(bool lockState)
doorLockState = lockState;
And the last script Door Hori is attached to each door childs of the door.
The door childs name as Door_Keft and Door_Right and they are moving to the sides left and right:
using UnityEngine;
using System.Collections;
public class DoorHori : MonoBehaviour
public float translateValue;
public float easeTime;
public OTween.EaseType ease;
public float waitTime;
private Vector3 StartlocalPos;
private Vector3 endlocalPos;
private void Start()
StartlocalPos = transform.localPosition;
gameObject.isStatic = false;
public void OpenDoor()
OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
GetComponent<AudioSource>().Play();
private void UpdateOpenDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( 1,0,0));
transform.localPosition = StartlocalPos + pos*f;
private void UpdateCloseDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( -f,0,0)) ;
transform.localPosition = endlocalPos-pos;
private void EndOpen()
endlocalPos = transform.localPosition ;
StartCoroutine( WaitToClose());
private IEnumerator WaitToClose()
yield return new WaitForSeconds(waitTime);
OTween.ValueTo( gameObject,ease,0.0f,translateValue,easeTime,0.0f,"StartClose","UpdateCloseDoor","EndClose");
GetComponent<AudioSource>().Play();
The first screenshot showing example of a door structure.
And the Horizontal_Doors_Kit Inspector:
The second and last screenshot show one of the Door_Left childs Inspector.
The script and settings values are the same on Door_Left and Door_Right:
My character FPSController have a Rigidbody attached a box collider to trigger the door.
c# unity3d
add a comment |
Once I'm entering the trigger area the door open.
If I'm staying inside the trigger area after the doors opened after some seconds the door will close on me. But in my logic the doors should be stay open as long as I'm inside the trigger area. The door should be close start closing only when leaving the trigger area.
Another problem is if I'm moving inside/outside the trigger area of the door too fast. Once I'm in the door start open when the door is opened if I will move back out the trigger area fast and move back in very fast again even if the door is still open it will play the open door animation again. I'm not sure how to solve this too fast entering/exiting problem.
I think the logic should be very simple.
Entering the trigger area open the door.
If I'm staying inside the trigger area while the door is opened finished open don't close the door ever until I'm exiting the trigger area then take some seconds and start closing the door.
If the door started closing and I'm then entering the trigger area again open the door at the point where the door is now even if it's in the middle of closing.
If I'm quick very fast entering/exiting the door trigger area keep handle it like in the first two rules. And don't play the open door animation if the door is already finished open and opened already. What if the play is running ?
The Doors Manager script is attached to a empty GameObject:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorsManager : MonoBehaviour
public List<HoriDoorManager> _doors = new List<HoriDoorManager>();
private void Start()
var doors = GameObject.FindGameObjectsWithTag("Door");
foreach(var door in doors)
_doors.Add(door.GetComponent<HoriDoorManager>());
public void LockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(true);
public void UnlockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(false);
The script Hori Door Manager is attached to the door child name Horizontal_Doors_Kit:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HoriDoorManager : MonoBehaviour
private bool doorLockState;
private List<DoorHori> doors = new List<DoorHori>();
private void Start()
if (transform.parent != null)
Transform parent = transform.parent;
var children = parent.GetComponentsInChildren<Transform>();
if(children != null)
foreach (Transform door in children)
door.name == "Door_Right")
doors.Add(door.GetComponent<DoorHori>());
void OnTriggerEnter()
if (doorLockState == false)
if (doors != null)
for(int i =0; i < doors.Count; i++)
doors[i].OpenDoor();
public void ChangeLockState(bool lockState)
doorLockState = lockState;
And the last script Door Hori is attached to each door childs of the door.
The door childs name as Door_Keft and Door_Right and they are moving to the sides left and right:
using UnityEngine;
using System.Collections;
public class DoorHori : MonoBehaviour
public float translateValue;
public float easeTime;
public OTween.EaseType ease;
public float waitTime;
private Vector3 StartlocalPos;
private Vector3 endlocalPos;
private void Start()
StartlocalPos = transform.localPosition;
gameObject.isStatic = false;
public void OpenDoor()
OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
GetComponent<AudioSource>().Play();
private void UpdateOpenDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( 1,0,0));
transform.localPosition = StartlocalPos + pos*f;
private void UpdateCloseDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( -f,0,0)) ;
transform.localPosition = endlocalPos-pos;
private void EndOpen()
endlocalPos = transform.localPosition ;
StartCoroutine( WaitToClose());
private IEnumerator WaitToClose()
yield return new WaitForSeconds(waitTime);
OTween.ValueTo( gameObject,ease,0.0f,translateValue,easeTime,0.0f,"StartClose","UpdateCloseDoor","EndClose");
GetComponent<AudioSource>().Play();
The first screenshot showing example of a door structure.
And the Horizontal_Doors_Kit Inspector:
The second and last screenshot show one of the Door_Left childs Inspector.
The script and settings values are the same on Door_Left and Door_Right:
My character FPSController have a Rigidbody attached a box collider to trigger the door.
c# unity3d
add a comment |
Once I'm entering the trigger area the door open.
If I'm staying inside the trigger area after the doors opened after some seconds the door will close on me. But in my logic the doors should be stay open as long as I'm inside the trigger area. The door should be close start closing only when leaving the trigger area.
Another problem is if I'm moving inside/outside the trigger area of the door too fast. Once I'm in the door start open when the door is opened if I will move back out the trigger area fast and move back in very fast again even if the door is still open it will play the open door animation again. I'm not sure how to solve this too fast entering/exiting problem.
I think the logic should be very simple.
Entering the trigger area open the door.
If I'm staying inside the trigger area while the door is opened finished open don't close the door ever until I'm exiting the trigger area then take some seconds and start closing the door.
If the door started closing and I'm then entering the trigger area again open the door at the point where the door is now even if it's in the middle of closing.
If I'm quick very fast entering/exiting the door trigger area keep handle it like in the first two rules. And don't play the open door animation if the door is already finished open and opened already. What if the play is running ?
The Doors Manager script is attached to a empty GameObject:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorsManager : MonoBehaviour
public List<HoriDoorManager> _doors = new List<HoriDoorManager>();
private void Start()
var doors = GameObject.FindGameObjectsWithTag("Door");
foreach(var door in doors)
_doors.Add(door.GetComponent<HoriDoorManager>());
public void LockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(true);
public void UnlockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(false);
The script Hori Door Manager is attached to the door child name Horizontal_Doors_Kit:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HoriDoorManager : MonoBehaviour
private bool doorLockState;
private List<DoorHori> doors = new List<DoorHori>();
private void Start()
if (transform.parent != null)
Transform parent = transform.parent;
var children = parent.GetComponentsInChildren<Transform>();
if(children != null)
foreach (Transform door in children)
door.name == "Door_Right")
doors.Add(door.GetComponent<DoorHori>());
void OnTriggerEnter()
if (doorLockState == false)
if (doors != null)
for(int i =0; i < doors.Count; i++)
doors[i].OpenDoor();
public void ChangeLockState(bool lockState)
doorLockState = lockState;
And the last script Door Hori is attached to each door childs of the door.
The door childs name as Door_Keft and Door_Right and they are moving to the sides left and right:
using UnityEngine;
using System.Collections;
public class DoorHori : MonoBehaviour
public float translateValue;
public float easeTime;
public OTween.EaseType ease;
public float waitTime;
private Vector3 StartlocalPos;
private Vector3 endlocalPos;
private void Start()
StartlocalPos = transform.localPosition;
gameObject.isStatic = false;
public void OpenDoor()
OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
GetComponent<AudioSource>().Play();
private void UpdateOpenDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( 1,0,0));
transform.localPosition = StartlocalPos + pos*f;
private void UpdateCloseDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( -f,0,0)) ;
transform.localPosition = endlocalPos-pos;
private void EndOpen()
endlocalPos = transform.localPosition ;
StartCoroutine( WaitToClose());
private IEnumerator WaitToClose()
yield return new WaitForSeconds(waitTime);
OTween.ValueTo( gameObject,ease,0.0f,translateValue,easeTime,0.0f,"StartClose","UpdateCloseDoor","EndClose");
GetComponent<AudioSource>().Play();
The first screenshot showing example of a door structure.
And the Horizontal_Doors_Kit Inspector:
The second and last screenshot show one of the Door_Left childs Inspector.
The script and settings values are the same on Door_Left and Door_Right:
My character FPSController have a Rigidbody attached a box collider to trigger the door.
c# unity3d
Once I'm entering the trigger area the door open.
If I'm staying inside the trigger area after the doors opened after some seconds the door will close on me. But in my logic the doors should be stay open as long as I'm inside the trigger area. The door should be close start closing only when leaving the trigger area.
Another problem is if I'm moving inside/outside the trigger area of the door too fast. Once I'm in the door start open when the door is opened if I will move back out the trigger area fast and move back in very fast again even if the door is still open it will play the open door animation again. I'm not sure how to solve this too fast entering/exiting problem.
I think the logic should be very simple.
Entering the trigger area open the door.
If I'm staying inside the trigger area while the door is opened finished open don't close the door ever until I'm exiting the trigger area then take some seconds and start closing the door.
If the door started closing and I'm then entering the trigger area again open the door at the point where the door is now even if it's in the middle of closing.
If I'm quick very fast entering/exiting the door trigger area keep handle it like in the first two rules. And don't play the open door animation if the door is already finished open and opened already. What if the play is running ?
The Doors Manager script is attached to a empty GameObject:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorsManager : MonoBehaviour
public List<HoriDoorManager> _doors = new List<HoriDoorManager>();
private void Start()
var doors = GameObject.FindGameObjectsWithTag("Door");
foreach(var door in doors)
_doors.Add(door.GetComponent<HoriDoorManager>());
public void LockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(true);
public void UnlockDoor(int doorIndex)
_doors[doorIndex].ChangeLockState(false);
The script Hori Door Manager is attached to the door child name Horizontal_Doors_Kit:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HoriDoorManager : MonoBehaviour
private bool doorLockState;
private List<DoorHori> doors = new List<DoorHori>();
private void Start()
if (transform.parent != null)
Transform parent = transform.parent;
var children = parent.GetComponentsInChildren<Transform>();
if(children != null)
foreach (Transform door in children)
door.name == "Door_Right")
doors.Add(door.GetComponent<DoorHori>());
void OnTriggerEnter()
if (doorLockState == false)
if (doors != null)
for(int i =0; i < doors.Count; i++)
doors[i].OpenDoor();
public void ChangeLockState(bool lockState)
doorLockState = lockState;
And the last script Door Hori is attached to each door childs of the door.
The door childs name as Door_Keft and Door_Right and they are moving to the sides left and right:
using UnityEngine;
using System.Collections;
public class DoorHori : MonoBehaviour
public float translateValue;
public float easeTime;
public OTween.EaseType ease;
public float waitTime;
private Vector3 StartlocalPos;
private Vector3 endlocalPos;
private void Start()
StartlocalPos = transform.localPosition;
gameObject.isStatic = false;
public void OpenDoor()
OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
GetComponent<AudioSource>().Play();
private void UpdateOpenDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( 1,0,0));
transform.localPosition = StartlocalPos + pos*f;
private void UpdateCloseDoor(float f)
Vector3 pos = transform.TransformDirection( new Vector3( -f,0,0)) ;
transform.localPosition = endlocalPos-pos;
private void EndOpen()
endlocalPos = transform.localPosition ;
StartCoroutine( WaitToClose());
private IEnumerator WaitToClose()
yield return new WaitForSeconds(waitTime);
OTween.ValueTo( gameObject,ease,0.0f,translateValue,easeTime,0.0f,"StartClose","UpdateCloseDoor","EndClose");
GetComponent<AudioSource>().Play();
The first screenshot showing example of a door structure.
And the Horizontal_Doors_Kit Inspector:
The second and last screenshot show one of the Door_Left childs Inspector.
The script and settings values are the same on Door_Left and Door_Right:
My character FPSController have a Rigidbody attached a box collider to trigger the door.
c# unity3d
c# unity3d
asked Mar 8 at 2:19
Dubi DuboniDubi Duboni
426110
426110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
But in my logic the doors should be stay open as long as I'm inside the trigger area.
But not in your code logic, your code logic is close the door after the door finishes opening.
private void EndOpen()
....
StartCoroutine( WaitToClose());
You need add OnTriggerLeave
event to close the door.
The second question is related to the first question, so please fix it first.
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna callEndOpen
fromOnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area
– shingo
Mar 8 at 9:24
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055806%2fi-have-a-problem-with-the-doors-when-they-open-and-then-im-waiting-for-them-to%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
But in my logic the doors should be stay open as long as I'm inside the trigger area.
But not in your code logic, your code logic is close the door after the door finishes opening.
private void EndOpen()
....
StartCoroutine( WaitToClose());
You need add OnTriggerLeave
event to close the door.
The second question is related to the first question, so please fix it first.
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna callEndOpen
fromOnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area
– shingo
Mar 8 at 9:24
add a comment |
But in my logic the doors should be stay open as long as I'm inside the trigger area.
But not in your code logic, your code logic is close the door after the door finishes opening.
private void EndOpen()
....
StartCoroutine( WaitToClose());
You need add OnTriggerLeave
event to close the door.
The second question is related to the first question, so please fix it first.
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna callEndOpen
fromOnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area
– shingo
Mar 8 at 9:24
add a comment |
But in my logic the doors should be stay open as long as I'm inside the trigger area.
But not in your code logic, your code logic is close the door after the door finishes opening.
private void EndOpen()
....
StartCoroutine( WaitToClose());
You need add OnTriggerLeave
event to close the door.
The second question is related to the first question, so please fix it first.
But in my logic the doors should be stay open as long as I'm inside the trigger area.
But not in your code logic, your code logic is close the door after the door finishes opening.
private void EndOpen()
....
StartCoroutine( WaitToClose());
You need add OnTriggerLeave
event to close the door.
The second question is related to the first question, so please fix it first.
answered Mar 8 at 3:29
shingoshingo
2,9862722
2,9862722
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna callEndOpen
fromOnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area
– shingo
Mar 8 at 9:24
add a comment |
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna callEndOpen
fromOnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area
– shingo
Mar 8 at 9:24
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
The problem is that the EndOpen is calling from the OTween.ValueTo line inside the OpenDoor method. How then I call the EndOpen from inside the OnTriggerLeave ? This is the line that call the EndOpen: OTween.ValueTo( gameObject,ease,0.0f,-translateValue,easeTime,0.0f,"StartOpen","UpdateOpenDoor","EndOpen");
– Dubi Duboni
Mar 8 at 8:51
Why you wanna call
EndOpen
from OnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area– shingo
Mar 8 at 9:24
Why you wanna call
EndOpen
from OnTriggerLeave
? You said your logic is: The door should be close start closing only when leaving the trigger area– shingo
Mar 8 at 9:24
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055806%2fi-have-a-problem-with-the-doors-when-they-open-and-then-im-waiting-for-them-to%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown