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
-1
Question by emreozpalamutcu · Aug 24, 2012 at 03:22 PM · cameramovementphysicsjumpingmomentum

Movement Script for Player...

I need a movement script for my player which is a sphere. I found couple on the internet but they don't do what I want them to do. Some does, but they have so much code that I don't need.

Here is what I need in this movement script:

  1. I need the player to be able to move in the x direction time.deltatime and on the z direction it should be able to move 2 unity units a time. I'm looking for the effect in little big planet.

  2. I need the character to be able to jump, however it shouldn't do double jump. But it should be able to move while in the air.

  3. The most important and hardest one is I need momentum on the sphere. What I mean by this is, I need the effect created by the bouncy physics material, the problem is this is not usable with the character controller. If you can get movement done without character controller, you could use sphere collider.

  4. I need the camera to follow the player in the y and the x direction only!

Thanks... I really need some help!

Comment
Add comment · Show 3
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 Mander · Aug 24, 2012 at 03:50 PM 0
Share

y isnt usable with character controlleR?

avatar image BananaClipStudio · Aug 24, 2012 at 04:02 PM 0
Share

If you would take some time to at least try to make a working script and post it on here I would be glad to help you. Please don't come here and ask for all of us to do all the work.

avatar image Meltdown · Aug 24, 2012 at 04:06 PM 0
Share

Nobody is going to write scripts for you here. If you don't want to do it yourself you can pay someone to do it for you in the Commercial Work section on the Unity forums

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cool Dave · Aug 24, 2012 at 04:40 PM

I've never seen Little Big Planet, but I'm guessing it's a ball rolling along the x which you control by sliding it on the z axis and jumping over obstacles.

Momentum has nothing to do with bounciness. I don't think you want to use character controller, however. Do you know much javascript? If you don't...

Let me shoot straight for a minute. You will never get anything done in Unity without knowing how to write the code. You can't use the already-made ones for everything. Javascript is really easy to learn, and you will become more productive quite quickly. I finally decided to learn, and I'm really glad I did.

For your script, attach a rigidbody to a sphere. Then using something like 'rigidbody.AddTorque (10,0,0);' you can give torque to the ball. To jump you need 'var makeBallJump : boolean = Input.GetButton ("Fire1");'

Attach this script to the ball to get started.

 function FixedUpdate ()
 {
 //Be sure to set your fire1 key assignment in Edit>Project Settings>Input
 var makeBallJump : boolean = Input.GetButton ("Fire1");
 
 //This makes the ball go up
 if (makeBallJump == true)
  {
  rigidbody.AddForce (0,40,0);
  }
 
 //This rolls the ball along
 rigidbody.AddTorque (10,0,0);
 }
 
 
 

Please mark this answer as correct, assuming it's helpful. Welcome to Answers!

Comment
Add comment · Show 1 · 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
avatar image emreozpalamutcu · Aug 24, 2012 at 05:34 PM 0
Share

I'm currently outside. I will be at home in 30 $$anonymous$$s I will post the script. I didn't post it because I thought It wouldn't have any use. And I changed $$anonymous$$d $$anonymous$$d about the question I will post it soon as I got home sorry thanks for trying to help.

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

11 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

Related Questions

Momentum locking jump 0 Answers

How do you calculate DeltaX and DeltaZ for a character? 1 Answer

Update() vs. FixedUpdate() for object rotation 2 Answers

How to check if object is on ground (C#)? 1 Answer

Jittery Movement - specific mechanics in mind 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