Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Azaroth · Aug 22, 2013 at 07:25 AM · rotateforcecolliding

Rotating gameobject not colliding

Hello, i have something like atrap in the game that rotates around and has spikes on it. The problem is that its not colliding with the player. I think i must use force but how cna i make it rotate?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Aug 22, 2013 at 08:26 AM 0
Share

There is not enough information here to help.

The problem is that its not colliding with the player : does the the trap simply go through the player, or stops when colliding with player?

What is your player, a character controller or a custom rigidbody controller?

  • think i must use force* : are the moving parts of your trap using rigidbody?

how cna i make it rotate : how can you make what rotate?

avatar image Azaroth · Aug 22, 2013 at 08:51 AM 0
Share

yes sorry,

no there is no rigidbody nowhere, the trap goes through the player that uses char controller.

Here si a image of the trap http://img16.imageshack.us/img16/1347/94ef.png

So i want it to rotate with a stable speed and colliding normally with the player how can i do that?

avatar image YoungDeveloper · Aug 22, 2013 at 10:06 AM 0
Share

Add a box collider to the trap. To spin the object attach this to object you want to spin. No need for any rigidbody. As you are probably checking the collision on player, oridinary oncollisionenter function wont work, you have to use oncharactercontroller. http://docs.unity3d.com/Documentation/ScriptReference/CharacterController.OnControllerColliderHit.html

When your player collides with the object, you can getcomponent of the colliding object script, in this case It's script called Rotate, and call the function Action() which will stop or continue spinning the trap.

 using UnityEngine;
 using System.Collections;
 
 public class Rotate : $$anonymous$$onoBehaviour {
     
     public bool spin;
     
     void Start(){
         spin =true;    
     }
     
     // Update is called once per frame
     void Update () {
         if(spin)transform.Rotate(0,1f,0); //Set the number 1f to higher or lower depending on fast yo want it to go
     }
     
     void Action(){
         if(spin) spin = false;
         else spin = true;
     {
 }
avatar image Azaroth · Aug 22, 2013 at 11:07 AM 0
Share

Thanks but i dont want to use the collision event yet. I just want to make the trap stronger than the player so it can throw him off the road. How can i do that?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Add force at position Question 1 Answer

Rotation Force on a model 2 Answers

Rotating a boat on two axes with force. 2 Answers

Rotate Object to Euler Angle using Physics? 3 Answers

Ball Rotating Help 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges