Sign in to follow this  
Yakuzashi

Projectile facing wrong way

Recommended Posts

Yakuzashi    146

Howdy. I need your help with projectile that is facing the wrong direction. It's artillery shell and I need its tip to be directed to the target. I have tried using

local function OnThrown(inst)
	inst.AnimState:SetOrientation(ANIM_ORIENTATION.OnGround)
	inst.AnimState:PlayAnimation("idle")
end

but it does not work. I have also looked into boomerang and blowdart and didn't find any clue. If someone approached the same problem in the past I will be grateful for your help.

Share this post


Link to post
Share on other sites
IronHunter    582

This is likely a problem with your spriter file, as rotation using ANIM_ORIENTATION.OnGround means it'll rotate the spriter animation to match the entities rotation in the world.

The default direction for said sprites should be facing to the right perfectly in line with the x-axis
If you want it to rotate like a boomerang then it's part of the spriter animation which animates it to spin around the origin (center of the x and y axis)

I am assuming you are familiar with how pivot points work for symbols in a spriter file and how they translate to in game animations.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this