Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Sylon87

  • Rank

Personal Information

  • Interests
  1. Sylon87

    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. Sylon87

    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. 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. 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. maybe you can solve it with OnCollisionStay(); just try it
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!