Комментарии:
Thank you!!!!!!
ОтветитьThank you
ОтветитьThank you, the tutorial helped a lot!
Ответитьsubscribed cus you rock!
Ответитьhow is your sky that color?
Ответитьgreat video ! thanks <#
Ответитьthe object does not float for me :(
ОтветитьCan u plsssssssssssssssssssssssssss give a link for the project?
ОтветитьCan u plsssssssssssssssssssssssssss give a link for the project?
ОтветитьCan u plsssssssssssssssssssssssssss give a link for the project?
Ответитьpublic Transform[] Floaters;
public float UnderWaterDrag = 3f;
public float UnderWaterAngularDrag = 1f;
public float AirDrag = 0f;
public float AirAngularDrag = 0.05f;
public float FloatingPower = 15f;
public float WaterHeight = 0f;
Rigidbody Rb;
bool Underwater;
int FloatersUnderWater;
// Start is called before the first frame update
void Start()
{
Rb = this.GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
FloatersUnderWater = 0;
for(int i = 0; i < Floaters.Length; i++)
{
float diff = Floaters[i].position.y - WaterHeight;
if (diff < 0)
{
Rb.AddForceAtPosition(Vector3.up * FloatingPower * Mathf.Abs(diff), Floaters[i].position, ForceMode.Force);
FloatersUnderWater += 1;
if (!Underwater)
{
Underwater = true;
SwitchState(true);
}
}
}
if (Underwater && FloatersUnderWater==0)
{
Underwater = false;
SwitchState(false);
}
}
void SwitchState(bool isUnderwater)
{
if (isUnderwater)
{
Rb.drag = UnderWaterDrag;
Rb.angularDrag = UnderWaterAngularDrag;
}
else
{
Rb.drag = AirDrag;
Rb.angularDrag = AirAngularDrag;
}
}
hey really good tutorials, quick question how would i go about limiting the physics to only work when inside the water plane? because ive noticed that moving the plane up or down doesnt change anything about the simulation.
Ответитьyou should make a link to have the code
Ответитьnice this helped me a lot thanks your teaching
ОтветитьNoice
Ответить🔥🔥🔥
ОтветитьIs there a link for the project please?
Ответитьso much thanks for these tutorials,however i didnt really need it becausei have my own solution but i thank you agian for creating these tuts for more people out there,you deserve more subscribers and views.
ОтветитьReally thanks, i needed help with that!
Ответитьwhy do you make public floats instead of serializing private floats? Just curious
ОтветитьGoodgoodgoood!
ОтветитьGold, Nothing more to say
Ответитьthanks man
👍
can someone help me my shipS all flip over
ОтветитьThank you
ОтветитьVery cool - thank you
ОтветитьThanks, can you make or do you have an example of a shader made with shader graph on HDRP to manage vertex displacement using a heightmap? thx in advance
ОтветитьThank you!
Ответить