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 Galad · Feb 12, 2011 at 07:49 PM · cameraspeed

Inspection camera script problem

Hello everyone.

I'm brand new Unity user and was just doing my first steps with Unity scripting. I even wrote my first camera script. It allows me to make my camera rotate around "observed" object in some specific way...

Thing is my script is working fine with Unity "play mode" as well as exported as a web player application. Things get much worse when I export it as windows "*.exe" file. I run it on the same computer but this time it is working much slower. I don't mean FPS rate but all the distanced that are calculated per frame are very small ( I hope you know what i mean ). It's even more strange when I try to run in on different computers. Exe file works fine on some machines and works "slow" on others... why ?? As i said its not a matter of fps rate. I also used Time.deltaTime factor while calculations so it should be frame independent... shouldn it ?

Does anyone have any idea what could be the reason of such behaviour ?

I couldn't make my script display properly so please find it here: http://www.nopaste.pl/ybf

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Feb 12, 2011 at 09:21 PM

Your problem is that Input.GetAxis("Mouse ScrollWheel") also returns delta movement just like Input.GetAxis("Mouse X").

You use the value as a event when it's greater or lower than "0". That means you don't need to multiply your speed with deltaTime. If you scroll one time upwards Input.GetAxis("Mouse ScrollWheel") will return a value greater that 0 for one frame. In the next frame it will be zero again. If your FPS is high, deltaTime will be very low.

In Webplayer the FPS is limited to 60fps by default, that's why it's faster than in standalone where you probably have more FPS.

distance += scrollspeed;

and

distance -= scrollspeed;
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
avatar image
0

Answer by Galad · Feb 12, 2011 at 10:17 PM

Thanks a lot man! I will take a closer look at it still today. That doesnt explain proper behavious in Unity "play mode" however... but still it's much more than i was able to find.

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

No one has followed this question yet.

Related Questions

Full scene speed-based motion blur 2 Answers

Move the camera to the left when the mousecursor is left 1 Answer

Stop Motion Camera Effect 0 Answers

stop camera when collision withh a wall ???? 1 Answer

Want Object to move freely in Camera's Limit 1 Answer


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