Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Jeremy-Borton · Nov 08, 2015 at 04:40 AM · cameracolliderterrainplayerspin

Terrain Spins when hit by player

I'm just staring out, so it's probably something simple I'm doing wrong.

Here's my Hierarchy:

 Directional Light
 Terrain
 Cube
       Sphere
              Cylinder //its my turret
 Player
       Camera

So if I have a plain flat terrain it works great, but as soon as I add hills it messes up. When my player falls a little onto the terrain, the terrain acts like a rag doll and falls on it's side leaving this weird half spun terrain.

I'm trying to write a basic script for my player which is a cylinder that has a capsule collider and a rigidbody, and mesh renderer. and my script which only says to update this: transform.Translate(Vector3.forward * player_speed);

I have no clue how to fix the terrain getting affected by physics it looks like.

Another thing is that my camera preview parented to my player only shows blue and grey in skybox mode, and nothing else. I have to put it on solid or depth to see my terrain in the camera preview.

Any help is much appreciated, Thanks, Jeremy

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by $$anonymous$$ · Dec 03, 2015 at 08:52 PM

Not sure what you are exactly asking for, but have you checked to see if you accidentally dragged a script onto the terrain itself? Also what version of Unity are you using because that can also determine if an update where certain bugs are fixed can resolve problems.

Also the type of movement you apply might also cause problems. But im not sure what you want exactly,

If you have used a capsul it already has a collider, so you don't need to add another one to it. If you are going to use something like a character controller you want to remove the other colliders (Sphere, capsule, box, whatever) because the character controller already has its own collider. You will keep the rigid body though for things like gravity, and position, or rotation locking,

Camera wise you should get use to not making the main camera part of the character, simply create a new Cam and make it child object of the player and name it Player Camera.

alt text

Get use to adding Tag as Player to your Player. But as you see here I have a Camera on the capsule, but it does not have a capsule collider, but rather a character controller that has its own collider. My Player Control script calls for that instead for my movement, but you can use whatever you are trying for,

On my rigid boidy you should also note Use Gravity is checked, and I have the Y on Position, but all three XYZ checked to lock into place. This is because with the scrip I am using I have movement. But locking these positions keeps it from flying off into space if something bumps the character, or i bump into something, etc.

This depends on the script also as this can in some scripts prevent movement altogether, but if bumped will still cause it to drag off slowly to wherever.

So, Make a Player Camera, and it will be the one your player will use, Choose the collider type proper to the movement script you use. Rigid body is what you will be adding to most of what you will be using for characters, enemies and weapon parts.


setup-player.jpg (166.0 kB)
Comment
Add comment · Share
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

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

39 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 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

My 3rd Person camera doesnt collide with Terrain... Please Help 0 Answers

problem ghosting camera with 2 objets 0 Answers

Camera Rotation Around Player 1 Answer

My trigger won't activate the UI when the player collides with it. 0 Answers

player not following camera rotation in vr 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