c# wpf 2d animation: Storyboard - c#

I am new to Silverlight but you have to start somewhere right?
For my school project I am working on a projectile simulator but I am stuck as to what to do for the 2D animation. when looking at a storyboard most of the examples have very little example for moving the object. Is using a storyboard a good idea for this type of animation or am I doing this completely wrong?
no idea what part of my code to put here so ask and ill edit.
thanks for your help!

Related

Unity 2D collision only from above

Im trying to make a simple cloud jumping game with Unity 2D and have faced a problem.
How would i make the player go "through"/"in front of" the cloud when coming under but colliding when coming down again. Or do i need to trigger the jump action somehow when "touching" the cloud without collision?
Thank you in advance. I hope my text was understandable.
I have tried many ways, i don't even know what anymore. Like with ontrigger but idk did i do it right, it didn't work, something with adding a new layer, and polygon collider but how do i even edit it clearly?
I need help :')

Automatic animation after previous in Unity- how to do something like that?

Automatic animation after the previous one in Unity - how to do something like that?
I mean, in my game, I performed the jump function and it has its animations, and how do you do that when it ends, the falling animation will start - that is, right after the jump animation,
Question: How can I start the animation immediately after two in Unity?
Please help!
Thanks to Unity's built in animator this is actually really easy to do without any code. All you have to do is setup a transition to the next animation after that animation plays. I'd recommend this tutorial to get started. (I've already set it to start at the part of the video where he actually talks about it)

The perspective in Unity 2D

I have issue with perspective in Unity. I'm just making a game alone and I have no idea how to fix the problem. I'm going to show you the problem on screenshots.
On the images, yellow color == collider lines
I want to go to the building closer.
I can't make collider like this:
Because it looks weird. I want it like this:
But to do this I have to change collider to something like this:
But there is still other issue... I can't go behind the building because the player won't "hide" behind the building like this:
Player will stop walking here:
I have no idea what to do now. I was trying to figure it out in any way. I was searching ideas/informations everywhere. I've run out of ideas, so I'm asking you here. Thank you in advance.

How do I Start/Stop an animation in Unity 5.3 (C#)

So I'm trying to start and stop my walk animation, in unity 5.3.
Something like this.
If(Input.GetKey(KeyCode.RightArrow)){
GetComponent<Animator>().Play("WalkAnimation");
}
else If(!Input.GetKey(KeyCode.RightArrow)){
GetComponent<Animator>().Stop("WalkAnimation");
}
But somehow this doesn't really work out for my.
thanks in advance for your help.
While this doesn't directly answer your question, using direct commands to animation is a legacy functionality, nowadays we use Mekanim animation state machine:
You can find a video tutorial here

C# Wpf Animation Projectile

I just started using WPF and searched on how to do animations, there is many good tutorials but i can't seem to find the specific thing i need.
My goal is to create a small circle to start at a location and when a timer ticks move the circle smoothly towards another point(within 1 second). There is going to be new starting points and target points each tick.
As i said im fairly new to WPF so XAML is a new area for me, so i don't know how to animate the movement or if i should draw the circle or use an image. I don't even know if this is hard or an easy thing to do.
For reference im trying to make it look like the projectiles in this link:
http://map.norsecorp.com/#/
Would appreciate any help or any google search words i should use.
/ Alexander
If you are trying to work with animations, WPF isn't the right tool for you.
I have done many projects in this direction in the past and i cant recommend WPF. You need to work with multiple threads and your code is getting messy very soon. WPF is optimized for buisness solutions not for drawing circles. You can use Unity 3D. Its easy to learn and there are many examples out there.

Categories