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 /
This question was closed May 08, 2018 at 12:41 PM by pcdrive for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by pcdrive · May 06, 2018 at 11:51 AM · effectinteractionlogiccard

Need help with card game logic of the cards effects.

Hi,

So... i already have my cards... i've chosen the long way, of creating a script for every card. And theres a base class they inherit everything from. I just overriden it's methods.... So its done...

The problem is that now... i run into a problem of getting the target coordinates of the effect from the user. the method call comes from the card and ends at the map who have a map with field gameobjects. If i try to make it wait, then of course i run into and infinite loop.

How others solve it? Every single thought is a help.

thank in advance.

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

  • Sort: 
avatar image
0
Best Answer

Answer by pcdrive · May 08, 2018 at 12:41 PM

Answer found:


(answered by DeathDelegateMethodIsOP on an other forum)


"If you make a queue of the cards, or card effects you want to activate, then you can make a statemachine out of the whole thing. This way you dont have to wait, since you are in a specific state, and the queue reserves the activation order.


For example: current state: beginround queue cards = (activated card1, activated card 2 ...)


hope this helped!"

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 tormentoarmagedoom · May 06, 2018 at 09:28 PM

Good day.

i dont understand exactly what you need.

You need to know a Vector3 position relative to other object?

Then just need this:

 Vector3 RelativePosition= (Object.transform.position - Me.transform.position);

the RelativePosition is a vector from me to the object.

Bye!

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 pcdrive · May 07, 2018 at 09:51 AM 0
Share

Thanks, but my problem is not that i cant get the coordinates. $$anonymous$$y problem is that i dont know how to wait for the input from the user without freezing up my game.

avatar image tormentoarmagedoom pcdrive · May 08, 2018 at 08:14 AM 0
Share

Give us more information, we dont know how your game is, how you detect inputs, what you want to happen when this misterious input is done!

What input? a mouse click from the player? Like Input methods like Input.Get$$anonymous$$eyDown?

Or you are just asking for a delay method? like Invoke ?

If you explain exatcly what you want, i will try to give you exactly what you need :D

Bye!

Follow this Question

Answers Answers and Comments

138 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

Related Questions

Making different card effects. 1 Answer

Modeling a harvester: collider or distance? 0 Answers

Finding unique interacting function within gameObject 0 Answers

Avoid using GetComponent to check if RayCast hit is interactable 0 Answers

How do I create good paint splatter effects 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