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 Schnickness · Apr 26, 2016 at 12:48 PM · 2d game2d-platformer2d-gameplay2d platformer2d array

Need Help Getting Basic Mechanics Started (2D Puzzle Platformer)

Hi all, first time asking a Question so hopefully someone can push me in the right direction or even help out :)

2D Game am working on has will work on a 16x16 grid of box colliders, with the intention of many levels made of modular blocks etc.

Need to implement a Charge mechanic on my Player Character.

Charge will deplete for every Grid Square moved through, need public Int Variables for both Charge and Squares moved through in order to tweak them around.

Need a way to make Certain Grid Squares ADD Charge and also DEPLETE Charge (for use in powering interactables, will worry about this later)

And finally, When Charge =< 0, Destroy and Instantiate Game Object.

Any help would be greatly appreciated as I have totally hit a Roadblock here.

That's what I get for sticking to the Art Side of Games Design xD.

Cheers.

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 Jessespike · Apr 26, 2016 at 07:14 PM 0
Share

Your plan sounds good. Now it just needs to be implemented.

Depending on how the character moves along the grid, fixed positions or free roa$$anonymous$$g, there are several ways to accomplish this. The simplest way may be with colliders (OnCollisionEnter, OnCollisionExit, etc). Start by making a script for the player, it will store the current charge amount. Then make script for the squares, it will have an int that deter$$anonymous$$es if the players is getting/losing charges, and add the collision logic.

Can't help more than this, try scripting it first and if you get stuck, paste the code and describe the problem you are encountering.

0 Replies

· Add your reply
  • Sort: 

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

58 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

Related Questions

"Invalid argument"? 0 Answers

How to fix spite character changing position when turning? 1 Answer

Does anyone know how to make an object(enemy) follow a path set by the player in a 2D side scroller? 1 Answer

How do you Isolate Physics2D.OverlapArea to a single script/gameObject/Instance? 0 Answers

Player Not Moving With Platform 2D 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