# Sylon87

Member

5

1 Neutral

• Rank
Newbie

• Interests
Programming
1. ## Trying to rotate an object in unity

It’s for my school, so i must do it without animation, thank’s you for the rotatetowards , i completly forget about it, i’ll try it tomorrow and let you know if works!
2. ## Trying to rotate an object in unity

Hi! thank’s you for your reply, but rotatearound is if you want that object never stop rotating, what i want is that it will stop exactly on 180 degrees
3. ## Trying to rotate an object in unity

hello,What i’m trying to do is to rotate my object pvot from -180 to -180, so a full rotation, actually i have this IEnumerator Rotate(float duration) { float startRotation = transform.eulerAngles.y; float endRotation = startRotation + 360.0f; float t = 0.0f; while ( t < duration ) { t += Time.deltaTime; float yRotation = Mathf.Lerp(startRotation, endRotation, t / duration) % 360.0f; transform.eulerAngles = new Vector3(transform.eulerAngles.x, yRotation, transform.eulerAngles.z); yield return null; } } But after some degrees it will rotate in a wrong direction, i suppose because quaternion works with x,y anyone can help me to fix it? thank’s u in advance
4. ## Help to simulate RE7 door system

hello everyone. i would just say i'm sorry for my bad english, i'll do my best to be more clear as possible. i'm doing some practice with Unity and C# and right know i'm trying to understand how to emulate the RE7 door system, where the player hands are going to push the door when is closest to it, i found a tutoria for UE4 on youtube but nothing for unity.. what i actually have is a raycast to detect when i'm in front of the door, i can just open it by call an animation on some button press but i want to emulate it, but i'm totally confused on how to do it this is my code for now private void CheckTheHittingDoor() { var fdw = transform.forward; RaycastHit hit; if(Physics.Raycast(transform.position,fdw,out hit,raycastLenght)) { for (int i = 0; i < _doors.Length; i++) { if(hit.collider.CompareTag(_doors[i])) { Debug.Log(_doors[i]); } } } } then this is the video link from youtube to show you what i mean. VIDEO thank's you in advance
5. ## Two instantiated gameobjects of same prefab are not triggering collision with each other

maybe you can solve it with OnCollisionStay(); just try it