Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hover effect to weather and error icons #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Gellert5986
Copy link
Collaborator

@Gellert5986 Gellert5986 commented Sep 21, 2024

(Resolves Issue #115)

This adds a nice hover effect to all weather icon and error icon.

This makes the scene less static, thus visually more immersive.

The script HoverAnimation includes the code for the hover effect. This is attached to each weather and error icon as a component.

@Gellert5986 Gellert5986 self-assigned this Sep 21, 2024
Copy link
Collaborator

@NetzwergDE NetzwergDE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting script, that should work, but for some reason isn't (tested build and run in Quest 3), maybe some other settings (rigidbody,etc.) are blocking the script from working...

keep in mind, that the clouds already have a floating animation provided (not as script, but as unity animations)

Comment on lines +7 to +8
public float amplitude = 2f;
public float speed = 0.5f;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable values instead of hard coded would be more flexible, but the given values should do the job

Comment on lines +12 to +14
Vector3 p = transform.position;
p.y = amplitude * Mathf.Cos(Time.time * speed);
transform.position = p;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea should work, simple mathematics, using the cos is a good idea! 👍
(for better extensibility and readability you can put the code in a new function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants