This sort of thing already crossed my mind, but to be affected by splash damage weapons and not much for walking through though.
Things like trees bending at the detonation of a nuke for example, stuff like that (I even experimented a bit with it in the far past, when I was still the noobest of noobs at this stuff).
Either way, here's what I think: doing it as an animation is the best and most realistic way to go in this engine.
If you do that, an idea I personally had was to animate it from at least 9 different spots (9 animation sequences): as if the plant was being touched from each one of 8 sides (2 axis plus the diagonals), and one in the middle (where it gets more squashed).
From there, in theory, you could set an animation sequence on touch, and have the plant to transition to another seamlessly, all depending on your position relative to the plant, making the whole effect extremely accurate and good looking.
But in this approach, I am not 100% sure if you can actually do this: for many things I did in the past I had mesh overlays which would match the AnimSequence
of the original actor, and even if the actor was tweening
between animation sequences instead of animating a specific sequence from start to finish (which a player actor does a lot for example), I imagine that tweaking the AnimSequence
alone are enough to somewhat make a tween animation between 2 different sequences, but I never really looked into it at all.
The other more simplistic approach, without any animation at all, it's a bit like PrinceOfFunky mentioned, but rotating the plants themselves, and do so every tick while they're being touched, since their rotation must be recalculated no matter how little you move so it matches what you expect to see in the end (a rotation where the plant kinda "looks away" from you), but it should only be a slight otherwise it will look very wrong.
In addition to this, you can perhaps try to toy with other properties, such as Fatness
, by decreasing it to make the plant look slightly slimmer while it rotates, and even LODBias
, by also decreasing it to make the plant morph and distort a little bit.
For plants which is mostly green leaves and nothing more, you can also try to spawn more of the same plant with different rotations, and then depending on where you are, only one of them would actually rotate while the other plants would stay the same.
A similar approach to this would be to modify those plants somehow to split them into different singular leaves, and then once placed in a map, you could spawn the leaves and do the same thing.
Just my 2 cents
JackGriffin wrote:This is actually a pretty good idea. I tried a version of this where I altered the rotation, yaw, pitch, etc a bit in tick (and then in timer) to see if I could get a decent enough effect. None of it looked good at all. It just appeared that the plant was doing things it shouldn't. This just may not be a possibility or I'd have seen something already in a past mod.
Also, I forgot that we cannot choose a pivot point in UT differently from Unreal, so the only way to rotate the plant from the bottom is to attach it to another actor which should be placed at the bottom of the plant and rotate that actor instead.
You can: UT also has PrePivot
, it's just not exposed in UEd unlike in Unreal, but it's there and exposed to UScript, so you can freely change it through defaultproperties or code.
But even if you didn't have it, you wouldn't need to do all that.
If you want to rotate an actor relative to an arbitrary 3D location, all you need to do is to define that location, let's say NewPivot
, calculate the vector from it to the actor location ( V = A.Location - NewPivot
), rotate it ( V = V >> SomeRotation
), and in the end set the actor location to where the rotated vector is now pointing at ( A.SetLocation(NewPivot + V)
It would be a matter of applying a bit of math, and do what the engine itself would do anyway, but without the actor overhead.