Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Duzo · Jan 14 at 08:45 PM · bugglitchbugsglitching

Missing objects

Hello guys!

First of, I'm a total noob of creating games and I'm about to create my first one.

I think my unity is glitching or I rather know. Some objects like bushes sometimes disappears, objects seems to be over one more layer when they are supposed to be under. These things happen in the scene and when I start the game, everythings turns back to normal. My characters speed changes over time, I have my normal speed virable set to 7 but now when I come back to unity, 7 is way to slow and have to increase it to around 55 to be able to get the same speed as before. After some time though the speed goes back to normal and 55 becomes waay to fast.

So I can probably think it takes some time for unity to get warmed up? If this is the case then how can I get it to work faster?

One more thing is when I walk with my character, sometimes when I walk left or right my characters goes under some layers all of a sudden. This happens only sometimes and sometimes everything works fine. And I just created another room in my 2D game and in that room when I go left my character disappears but it still walks.

Is there anyone here that knows how to fix this? I hope that I explained it good enough for people to understand what I'm dealing with here. xD My specs on the computer im using is: processor: AMD Ryzen 7 5800H with Radeon Graphics 3.20 GHz Graphic card: NVIDIA GeForce RTX 3080 Laptop Ram: 16gb

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 mf41z · Jan 15 at 03:12 PM 0
Share

Those can be caused by a lot of things, I guess. So it's kinda hard to know. First of all, for the disappearing sprites, that could be caused by clipping. If the Z values of the sprites are too close, they will clip and behave weirdly. So check that out, if altering the Z values help with that problem. And for the speed changes overtime, try moving the movement to FixedUpdate() rather than Update(), and use Time.fixedDeltaTime for calculating speeds and such. Not sure if that will work, but it's worth a try, I guess. Are you moving your character with ApplyForce()? I'm moving my character with that method, and I'm having the same problem as you are, but I'm working on 3D enviroment. Now for the walking left and going under layers, that could also be caused by moving with ApplyForce(), because if you apply one wrong force in one frame, your character could move in Z axis, and that would just mess up the whole thing. And again, if the new room you created is in a different height, your character will disappear when walking into it. TL;DR 1- Sprites could be disappearing randomly because of changes in the Z-axis 2- Try moving your movement to FixedUpdate() rather than Update(), and use Time.fixedDeltaTIme in your calculations. That COULD fix the movement speeds 3- The room problem could also be caused by changes in Z-axis, so check that out

hope that helps, if not just ask

avatar image Duzo mf41z · Jan 22 at 05:35 AM 0
Share

Did change to FixedUpdate() and also changed Time.FixedDeltaTime and so far it seems have solved the issue with the moving speed. I played around with the sorting layers and re-did some things. And now everything works fine. But I will keep the z-axis in $$anonymous$$d when problems like this appear.

Thanks for your reply m8.. Really appreciate it :)

avatar image logicandchaos · Jan 16 at 04:24 PM 0
Share

unity does not need to warm up, the discrepancy in speed is probably caused by lag or other things taking up memory, what you need to do is tie speed into time, so you would do speed*Time.deltaTime or Time.fixedDeltaTIme if in fixed update, when applying speed in your code.

avatar image Duzo logicandchaos · Jan 22 at 05:36 AM 0
Share

Yeah I did this and so far it works! Thanks man for you reply :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Duzo · Jan 20 at 12:48 PM

I solved it for now.. It had to do with sorting layers xD.. All though the character speed differs from time to time and when the character walks it is a bit choppy.. Is it possible it is just the unity engine that is slow and will work as it should when you make it into an actual application?

I still think there are some settings that could make unity work faster or peform better? If there are then please tell me what settings are recommended!

Comment
Add comment · Show 2 · 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 Chubzdoomer · Jan 20 at 11:12 PM 0
Share

How are you moving your character? Are you remembering to multiply by Time.deltaTime when doing so?

avatar image Duzo Chubzdoomer · Jan 22 at 05:37 AM 0
Share

Yeah I multiply the speed with Time.FixedDeltaTime now... Had Time.DeltaTime before and I think this was the issue.

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

156 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 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 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 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

[ISSUE] My first 4 waves are looping and not allowing further waves to spawn,My first 4 Waves are looping and not allowing my other waves to spawn 1 Answer

script only working on first run 1 Answer

Weird double-tap bug when I use standart controller (Android) 0 Answers

Point of light bug 0 Answers

W Hotkey Bugged 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