• 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 belamessex · May 10, 2017 at 07:09 PM · editorprefabbug

[Bug?] Prefab Instantiates with wrong public variables

Hey everyone, I have a main character prefab that I've been instantiating on start without problems for months. Recently, she's been instantiating with her public move mult and public gravity mult variables magically changed so that she moves really slow and falls really fast. Normally, I'd post my code and ask for help... BUT, here's where it gets weird: While in play mode, I clicked on the prefab instance in the hierarchy to check if the variables had changed, and she instantly started working as normal... Just from clicking on her instance in the hierarchy. I've found that once she is normal again, if I press pause then press maximize on play, as soon as I press play, it maximizes, the problem returns. This seems like a bug in the editor. Any ideas?

Thanks

Comment
Add comment · Show 1
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 ocelotBT · Sep 29, 2017 at 07:43 AM 0
Share

Hey, I have the same problem. Did you resolve it?

Thanks

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tormentoarmagedoom · Sep 29, 2017 at 10:14 AM

Hi @belamessex !

It is really strange, can you say me where do you initialize the values? when declaring the variables? or at the Start function? or where? And can you check in editor without runing, if the variable value at the inspector is the same as int he script.

If you initialize a public variable when declarin that variable, but you have a diferent value in the inspector, the value that will be loaded is the inspector value. You have to initialize the value at the Start funcion to provent this.

But this problem that disapear while clickiing the object during runtime... is so strange. Maybe you should take a look at Bug Report Page.

Bye!! :D

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

96 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

Related Questions

Text missing in Editor; huge amounts of bugs and glitches 0 Answers

How to modify prefab permanently via script. 0 Answers

Selecting a newly created empty prefab by an editor script 0 Answers

Generating a prefab from Audio Clip via script 1 Answer

Breaking a prefab connection 7 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges