About Store Forum Documentation Contact



Post Reply 
set Pos for actor only by one axis
Author Message
andrake Offline
Member

Post: #1
set Pos for actor only by one axis
Hi

i have 3 actors:
Actor physBody,physBodyVert, finalphsBody;

1 for moving horisontal
1 for moving vertical(jumping)
1 that get horisontal and vertial position from first two

i need that second actor be at the same X position as first. but only x position.

physBodyVert.Pos(physBody.pos().x, leave untouched, leave untouched)

"leave untouched" i mean position get from physEngine calculating for this two axis
(This post was last modified: 12-16-2014 03:50 PM by andrake.)
12-16-2014 03:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: set Pos for actor only by one axis
Vec original=get..;
set(custom_x, original.y, original.z);
12-17-2014 12:41 AM
Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #3
RE: set Pos for actor only by one axis
if i will set for jumping actor at every frame original.y - it will can't jumping at all by addImpulse or other physics forces. it will be at the same place all the time exclude x axis.

i will create little scene for show idea and the problem. problem is that : when Chr jumping - he moving faster when he in air. because on ground is friction presented.
but it physically wrong - in air he should not accelerating.
12-17-2014 06:21 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #4
RE: set Pos for actor only by one axis
Try to block input when in air.
12-17-2014 07:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #5
RE: set Pos for actor only by one axis
and if i will want to control presonage in air with linear speed(without accelerating) or with the same speed as on ground?

now i understood that approach with two physbodies(one for every axis) is not good if personage will need to jumping over hole.
12-17-2014 08:11 AM
Find all posts by this user Quote this message in a reply
Post Reply