Jump to content



Photo

Animation - Drop Targets


  • Please log in to reply
5 replies to this topic

#1 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 04 May 2014 - 07:14 AM

I hadn't looked through script for addams family before but that one is documented nice for models. I could just about grasp how to get something going but came into a small problem which I cannot fix for now :)

 

Obviously if it wasn't a toy in FP you would use a drop target. This is how I can remember doing a ramp starter for example, just a simple hinge. Put the model in and switch on & off (up,down).

 

 

Can see the problem here. The ramp (drop target) starts off in correct position but something in the code moving it up? Angle.. Can some of this be removed just to allow the model into the table and be switched and not moved? Surely me using a drop target here is a bohemian way of doing it now.

public class drac_l1_StartRamp : MonoBehaviour
{
	 Animation anim;
	 float animSpeedSaved = 0f;

	 void Start()
	 {
		try{
		 anim = gameObject.transform.FindChild("RampStart_animated").animation;
		 animSpeedSaved = anim["anim"].speed *6f / Time.timeScale;
		 BxTableManager.s_TableManager.AddSolenoidCallBack(8,RampCB);
		 }catch{ Debug.LogError("Error while setting Starter Ramp.");}
	 }
	
	
	 float angle=0f;	// current animation angle
	 bool state = false;

	 void Update()
	 {
		 if(!state)
			 {}//angle = 0f;
		 else
		 {
			 angle += animSpeedSaved * Time.deltaTime * 30f;
			 angle = angle<0f  ?  0f : angle;
			 angle = angle>30f ? 30f : angle;
		 }
	 }
	
	 void RampCB(int slot, bool b)
	 {
		 state = b;
		 anim["anim"].speed = b ? animSpeedSaved : -animSpeedSaved;
		 anim.Play("anim");
	}
}

Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000


#2 BilboX

BilboX

    Enthusiast

  • Unit3D Pinball Team
  • 433 posts
  • Location:French Polynesia

  • Flag: France

  • Favorite Pinball: Metallica, Addams Familly, Scared Stiff, White Water

Posted 05 May 2014 - 11:29 AM

I don't know this table. Is it meant to move in the opposite direction?

Is diverter not more indicated? Is it a toy?


UP2


#3 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 05 May 2014 - 12:35 PM

Ramp is lifting up as it should on solenoid but I think the code moves it up on Z plane as the animation starts.

 

Also seems to leave the original collider there? because the ball is supposed to go under it as it lifts up.

 

I haven't tried bringing in as a diverter, that could be an idea.


Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000


#4 BilboX

BilboX

    Enthusiast

  • Unit3D Pinball Team
  • 433 posts
  • Location:French Polynesia

  • Flag: France

  • Favorite Pinball: Metallica, Addams Familly, Scared Stiff, White Water

Posted 05 May 2014 - 02:16 PM

It seems to be a collider problem. Moreover, this object seems to have an integrated animation, you should not animate it "by hand".

 

Send me the table, I'll check it...


UP2


#5 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 05 May 2014 - 02:19 PM

It's a drop target I made with animation yes in Milkshape.


Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000


#6 paulkyriakides

paulkyriakides

    Hobbyist

  • Members
  • PipPip
  • 49 posts

  • Flag: South Africa

  • Favorite Pinball: Attack from Mars

Posted 11 May 2014 - 10:29 AM

for some reason the drop targets in front of the big ufo in the attack from mars tables i have on my cab have also just stopped working